I have a main process that owns a Model object. The purpose of this is to share a Model between various objects that performs tasks and modifies the same Model.
Right now, I create a unique_ptr to this object and pass a reference to that unique_ptr to other objects to perform certain tasks.
The tasks all complete correctly, but something weird happens when it tries to call the destructor on the unique_ptr. It shows:
RAW: memory allocation bug: object at 0xd0ebdfb2b8 has never been allocated
Question:
- Why is this error happening?
- Is unique_ptr the right way to tackle this problem?
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…