Ghost visual models remaining after deletion

asked 2019-01-06 14:26:28 -0500

david_d gravatar image

Hello. I have encountered a recurring bug.

I have a simple world plugin that creates several objects, waits a few seconds, deletes the old objects, and repeats this process several times.

Occasionally, unpredictably, a model will be deleted, but it's visuals will persist, spoiling the data for the remaining iterations. The "ghost models" are reported to not be there with WorldPtr->Models(), but are reported to be there using ScenePtr->WorldVisual()->GetChildCount(), and similar methods.

Strangely, this only seems to occur on the first iteration of the create delete cycle, but I cannot determine what is special about the first cycle as opposed to the other cycles that would cause this bug to occur.

You can see the relevant source code here. I have mitigated the issue with a hacky workaround, but I'd like to determine the root cause. Thank you for your help.

edit retag flag offensive close merge delete