Objects destruction

Post Reply
Anton Petrov
Posts: 8
Joined: Thu May 03, 2007 10:07 am

Objects destruction

Post by Anton Petrov »

Hi everybody!

I assume my question is somewise stupid, but...

Many Bullet classes expect other objects to be passed in during instance construction. And my question is: does the Bullet library expects me to delete all those Bullet objects I have created? Or there are classes which take care of objects they have received via constructors?

Thank you.
Proctoid
Posts: 18
Joined: Fri Apr 21, 2006 3:04 pm
Location: uk

Post by Proctoid »

The general rules is if you create an object it is your responsibility to delete it.

If you find deleting something causes a crash then it is easy enough
to find the problem. A few minutes spent looking at class constructors and then searching for the particular object variable destruction is simple because we have all the bullet source code!

In Windows i use the _CrtMemCheckpoint etc debug memory functions - this is so very useful to see what has not been freed when your app exits
or when you accidentally delete something that has already been deleted.
Post Reply