Bug #3897

By dumganhar Posted 2014-02-07 02:36

For more info:
http://www.cocos2d-x.org/forums/6/topics/34011?r=44278#message-44278

Basically, we moved many constructors to `protected`. That is good, since it will prevent many memory leaks.

But advanced users my still want to create objects manually, or even create objects in the "stack".

And we should support those use cases.

So, a user suggested to do the following:

```cpp
#ifdef CC_ENABLE_CONSTRUCTORS
#define PROTECTED_CONSTRUCTOR protected
#else
#define PROTECTED_CONSTRUCTOR public protected
#endif
```

I think it adds little overhead, and advanced users will be happy with this compile-time feature.


I think it adds little overhead, and advanced users will be happy with this compile-time feature.

Back