Hi John,

----- Original Message ----- From: Argentieri, John-P63223
Sent: Friday, November 10, 2006 6:52 PM

I think I am not deleting particle systems properly, as it seems the
more of them that I create, the more bogged down my application gets.
Fire and Smoke I need to turn on and off manually, so I have set their
Emitters to run endlessly. What is the correct way to ensure that they
are properly deleted?

More generally, If I construct a subtree and attach it to my scene, is
it sufficient to simply remove the subtree by the root in order to
free up the memory, or do I have to deconstruct it completely?

Yes this should do it, provided that the only osg::ref_ptr
(external to your subtree) that points to some node in your subtree is a
subtree_root_parent. Then subtree_root_parent->removeChild(subtree_root)
should delete the entire subtree.

With regard to your first question, I cannot say what the problem might
be. If you suspect deletion problems, you might want to track manually
the reference counts of some nodes in your effects, like emitters /
updaters / geodes holding particles, by printing out the reference
counts just before you call removeChild(effect_root). If any of them
have reference counts 2 or more, they will not get deleted. Modifying
existing OSG example, say osgviewer, to do only repeated creation and
deletion of your effects might also give you some insight.

Best regards,
Sinisa

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to