I am trying to use removeImageLayer() but my application keep on crashing in Debug mode. I read on a previous post that osg is not thread safe and I should not be calling this function from a different thread. Can anyone give me an example of how I post a message to my thread so I can perform my action? Do I use osg::Operation? or is there a newer better way?
Thank you for the reply. I did a bit more research. When I was removing the layer I did not see the memory being freed as I would expect, so I was doing a delete on the layer that I had created. Obviously this was causing a problem later on. I later found out that the version of osgEarth that I was using had some problems with freeing up the layer memory so I upgraded to version 2.9.0. Now it is all working very nicely.