I have created a
QgsRasterLayer object using:
and the layer is displayed by:
Now when this layer is removed through:
I am unable to reload it on the interface. I get below error:
RuntimeError: wrapped C/C++ object of type QgsRasterLayer has been deleted
From what I understand the refrenced object of
lyr is deleted.
I need a workaround for this so that I can load and unload
lyr multiple times. Since the layer object is created dynamically for so recreating it is not an option.