开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜