Hi Devs,

In a python plugin I had an issue in which somebody had created a 'group layer' (in a Python plugin), and saved it in 'the default project'. BUT when the plugin did 'find' that group layer (via it's name) and tries do call a method on it you get the dreaded:

"wrapped C/C++ object of type QgsLayerTreeGroup has been deleted" message.

So my question: is there a proper way in Python, to check if the 'underlaying' c++ object is still alive/available?
( other then in a try/except clause try to call a method :-) )
I'm gooing for the try/except hack now, but maybe it is an idea to add an 'isValid' or so to all PyObjects?

OR is this specific case a QGIS issue, as creating a GroupLayer maybe should also create a c++ grouplayer?

Regards,

Richard Duivenvoorde

PS this is NOT garbage collecting related, it is not that I can save an 'handle' to the object: it is an (empty) grouplayer saved in a project.
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to