On Mon, Aug 9, 2010 at 9:57 PM, Peter Ersts <[email protected]> wrote: > ---theLayer.setRasterShaderFunction( myColorRampShader ) is also not > necessary, because you are already working with the actual shader (i.e., > myColorRampShader ). This will also cause a crash/segfault because the > setRasterShaderFunction() now is deleting the existing function and > replacing it with the new, however, in this case it is deleting itself. > MARTIN: This was why QgsRasterLayer managed deleting the functions and > checked to see if the QgsRasterShaderFunction was user defined. I saw too > many possibilities for crashes if the shader itself managed the deleting of > functions. This case illustrates on instance of that problem.
Hi Pete, I believe this can be fixed easily by testing whether the new shader function isn't the same as the previous one in setRasterShaderFunction(). Do you see any further scenarios that might lead to a crash? Because deleting the shader function in the class where it belongs is typically less prone to memory leaks or double deletion. Bye Martin _______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
