Hey ya'll,
I notice that when i use a deconstructer it automatically gets called at startup of the code generation thingy...
so my question is : if it destructs at startup, why use it :S ?
Is deconstructers bad :S ?
-
- Posts: 212
- Joined: Sun Jul 19, 2009 4:24 am
- Location: Netherlands Antilles, Curacao
hu ???
the destructor should only get called when you destroy the object but the constructor when you create the object !!!
and both are often usefull and needed...
I guess there is something wrong with your code...
the destructor should only get called when you destroy the object but the constructor when you create the object !!!
and both are often usefull and needed...
I guess there is something wrong with your code...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
- Posts: 212
- Joined: Sun Jul 19, 2009 4:24 am
- Location: Netherlands Antilles, Curacao
Code: Select all
class A
{
IrrlichtDevice* Device;
public:
A()
{
cout << "A()" << endl;
Device = createDevice();
}
~A()
{
cout << "~A()" << endl;
if( Device ) Device->drop();
}
};
int main()
{
A a;
return 0;
}
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
deconstructer... I'm never going to get that word out of my mind now!
The rule for Irrlicht is - only call drop() when you created with a function starting with create, when you used new or when you did a grab().
The rule for Irrlicht is - only call drop() when you created with a function starting with create, when you used new or when you did a grab().
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 212
- Joined: Sun Jul 19, 2009 4:24 am
- Location: Netherlands Antilles, Curacao
-
- Posts: 1186
- Joined: Fri Dec 29, 2006 12:04 am
-
- Posts: 212
- Joined: Sun Jul 19, 2009 4:24 am
- Location: Netherlands Antilles, Curacao
I thought my post nade this clear, but maybe it was a litle bit too subtile...Lil Margin wrote:hahahaha destructer, lol funny me XD
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java