Advertisement

class with size=0

Started by June 28, 2006 05:28 AM
1 comment, last by Maddi 18 years, 5 months ago
Hi, In the Documentation you state that if a class is registered with a size of 0, it cannot be instanciated. While this is true for variables defined in a function, member variables of a class can still be declared without the @. This has the side effect that angelscript tries to release the uninstanciated object when cleaning up, which causes a very hard to trace access to an uninitialized pointer. Example:


// as Code

class test
{
 void func()
 {
   size0class testInstance; // This fails as expected
 }

 size0class m_instance; // This does unexpectedly not fail, but triggers an access violation
}

Whatsoever I really got used to as and Im really happy with it. Keep it up, Maddi
Ah, thanks for letting me know. I'll fix this before the release of version 2.7.0.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement
Great, Thanks !

This topic is closed to new replies.

Advertisement