If all you ever use are the 'create' methods in Ogre, all you have to do is delete Root (or make it go out of scope if you stored it by value).
You only have to delete things that you 'new' yourself. You never have to delete scene nodes, and you shouldn't try to (it will crash). OGRE manages everything it 'new's.
If you are ever in doubt, you can also just run your program and check the OgreLeaks.log file afterwards. As far as I can tell, Ogre does a pretty good job at detecting memory leaks.
Unlike COM (<cough>garbage<cough>) our shared pointers decrement automatically so you don't have to worry about manually decrementing them. You cannot manually increment them (nor should you ever need to). You do have to make sure your pointers go out of scope before you shutdown Root though, the result of not doing this is an assert.
sinbad wrote:You do have to make sure your pointers go out of scope before you shutdown Root though, the result of not doing this is an assert.
But only in debug mode, isn't it? Thanks.
Why I'm asking this? The problem is, that we have to put the smart pointers on the heap to use them in JNI or increment the usage count manually because of passing the Object pointer into Java. If a lazy programmer doesn't call the dispose function of each Java object, the usage count will not be decremented and/or smart pointers on the heap are not deleteted.
sinbad wrote:You do have to make sure your pointers go out of scope before you shutdown Root though, the result of not doing this is an assert.
But only in debug mode, isn't it? Thanks.
Well yeah, but that's why you run everything in Debug mode first, right? Once you realise you made a mistake, you fix it so it'll never occur in Release.
sinbad wrote:Well yeah, but that's why you run everything in Debug mode first, right? Once you realise you made a mistake, you fix it so it'll never occur in Release.