I use boost::intrusive_ptr like this:
void func() {
boost::intrusive_ptr < MyObject > obj = new MyObject();
getStage()->addChild( obj );
}
If I understand this code right - here I get a memory leak because I don't free memory which was allocated for MyObject. How can I free it to avoid a memory leak?