I need to know which pointers i have to delete.
I've readen in a post that i have to delete scenenodes. Is that right?
What pointers do i have also to destroy!
(a complete list if possible )
thx in advance
deleting pointers
- Shinobi
- Kobold
- Posts: 27
- Joined: Thu Dec 16, 2004 5:01 pm
- Contact:
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
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.
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.
- Shinobi
- Kobold
- Posts: 27
- Joined: Thu Dec 16, 2004 5:01 pm
- Contact:
- Devil N
- Greenskin
- Posts: 123
- Joined: Sun Jun 26, 2005 4:32 pm
- Location: Groningen, The Netherlands
- Contact:
- Yavin
- Bronze Sponsor
- Posts: 140
- Joined: Wed Mar 02, 2005 3:41 pm
- Location: Lake Constance, Germany
- Contact:
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
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.
- Yavin
- Bronze Sponsor
- Posts: 140
- Joined: Wed Mar 02, 2005 3:41 pm
- Location: Lake Constance, Germany
- Contact:
But only in debug mode, isn't it? Thanks.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.
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
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
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.Yavin wrote:But only in debug mode, isn't it? Thanks.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.
- Yavin
- Bronze Sponsor
- Posts: 140
- Joined: Wed Mar 02, 2005 3:41 pm
- Location: Lake Constance, Germany
- Contact: