question about: drop()

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
dmbush
Posts: 6
Joined: Fri Jul 25, 2008 11:46 pm

question about: drop()

Post by dmbush »

Hi, I'm brand new to irrlicht and these forums and had this question.

We all know memory leaks are bad, so I wanted to better understand use of the drop() function in irrlicht objects. My main question is, what determines which objects need to be dropped?

For example...

Lets say I have a reference to the device on which I called createDevice(), I also have a reference to the video Driver, scene manager and gui environment objects. I also load a few textures with the video driver by calling getTexture();

before my application terminates which of these things (or all) need to be dropped to avoid memory leaks. And how can I tell in the future which objects must be dropped?

or does pDevice->drop() magically fix everything? *crosses fingers* :)

If my question was confusing please tell me so I can rephrase it. Thanks in advance for help.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

You only call drop() when you called createSomething(), "new Something()" or when you did a Something->grab().

When you call getSomething() you don't have to, so usually you'll only need to drop the device (because it was created by createDevice)
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
dmbush
Posts: 6
Joined: Fri Jul 25, 2008 11:46 pm

Post by dmbush »

Wow, quick response. This place could grow on me :). That clears it up thank you!
Post Reply