I remember someone saying if you create a class through a lib you should destroy it through the library. So, does this mean I shouldn’t call delete? I should call myclass.deleteMe() instead? Would overloading delete solve the problem?
I remember someone saying if you create a class through a lib you should
Share
A problem with your application’s deleting something that was created within a lib is that the lib might use a different heap/memory manager.
Solutions include:
delete this;operator deletewithin the class, implemented within the library … if there’s a custom operator delete then it will called if and when your application delete an istance of the object.