I have some questions on how Irrlicht management memory. I didn't find the document about that.
1, We should never use C++ "delete", right?
2, All objects are inherited from IReferenceCounted, that's why we don't "delete", right?
3, Is there any name convention? Is any function name start with "createXXX" returning an object and transfer the ownership? That's to say, for any object returned by createXXX, we must "drop" it?
4, From this page,
http://spottedsun.com/irrlicht-drop-remove-and-delete/
For ISceneNode, we should use "remove" instead of "drop", right?
Thanks in advance.
Questions on memory management convention
Questions on memory management convention
http://www.cpgf.org/
cpgf library -- free C++ open source library for reflection, serialization, script binding, callbacks, and meta data for OpenGL Box2D, SFML and Irrlicht.
v1.5.3 was released. Now supports Irrlicht 3D engine v1.8 in script binding.
cpgf library -- free C++ open source library for reflection, serialization, script binding, callbacks, and meta data for OpenGL Box2D, SFML and Irrlicht.
v1.5.3 was released. Now supports Irrlicht 3D engine v1.8 in script binding.
Re: Questions on memory management convention
Yes, it's pretty much just as you said. See the documentation for IReferenceCounted: http://irrlicht.sourceforge.net/docu/cl ... unted.html
And about ISceneNode - the remove is really about removing it from the scenemanager - it just deletes as well if no one else has a reference anymore. Personally I think ISceneNode::remove should probably have been ISceneManager::removeNode instead to make this more clear - at least you should think of it like that.
And about ISceneNode - the remove is really about removing it from the scenemanager - it just deletes as well if no one else has a reference anymore. Personally I think ISceneNode::remove should probably have been ISceneManager::removeNode instead to make this more clear - at least you should think of it like that.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm