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.
Pythy Python
Posts: 30 Joined: Sun Mar 29, 2015 1:31 am
Post
by Pythy Python » Sat Apr 18, 2015 9:29 pm
Code: Select all
IrrlichtDevice *device = ...;
device->drop();
Does device->drop() deletes all pointer objects that I created?
CuteAlien
Admin
Posts: 9734 Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:
Post
by CuteAlien » Sun Apr 19, 2015 11:12 am
It's a reference-counting mechanism which does delete pointers when the reference count reaches null. In Irrlicht you only call drop() when you did call grab() before or when you did create the object with a function which has name starting with the word 'create' or when you created the object with new.
Please check the documentation:
http://irrlicht.sourceforge.net/docu/cl ... unted.html
Pythy Python
Posts: 30 Joined: Sun Mar 29, 2015 1:31 am
Post
by Pythy Python » Sun Apr 19, 2015 7:33 pm
So that means I don't have to do this,
Code: Select all
IrrlichtDevice *device = createDevice(...);
delete device;
instead I do this,
am I correct?
CuteAlien
Admin
Posts: 9734 Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:
Post
by CuteAlien » Sun Apr 19, 2015 7:58 pm
Yes, correct. But please take a look at the examples when learning the engine. At least example "01.Hello World" which shows the basics.