intrusive_ptr => _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
I use boost 'intrusive_ptr' in my code but when I delete some objects I got a crash !
In fact I use the same 'intrusive_ptr' into a class and return it, like this :
typedef intrusive_ptr<Node> ref;
class MyContainer
{
ref SmartPointer;
};
class Compiler
{
private:
ref MyNode;
public:
ref getMyNode() { return MyNode; }
ref process() {MyNode.Reset(); ... return MyNode; }
};
MyContainer * c1 = new MyContainer();
c1->SmartPointer = compiler.process();
delete c1;开发者_如何学编程 <= CRASH
精彩评论