Hi Stefan,

Stefan Hackl wrote:

>
>But this crashes the application, because as it seems the call to
>"mgr->setRoot(scene2);" deletes the old Rootnode (= "scene").
>
>Is this a known/wanted behaviour?
>

yes, that's the wanted behaviour. If you replace the scene, the reference
counter of the scene-node is decreased.  As there's no other reference to
the scene node in your situation, it's deleted. To prevent this you simply
have to increase the reference counter of the scene nodes:

addRefCP(scene);
addRefCP(scene2);

To release the scene nodes later call

subRefCP(scene);
subRefCP(scene2);

You may also want to read chapter 3.2 from the starter guide where this is
explained.

http://www.opensg.org/downloads/OpenSG-1.2.0-UserStarter.pdf


Thomas



-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to