Closed freehour closed 6 years ago
This is obsolete with the current memory model. We switched to clear client-managed dynamic memory by use of unique and shared pointers. Before, this was likely a problem if you don't use the reference counting throughout your code.
Maybe I missed something, but isn't the client application of the library supposed to call
delete this;
, since it also creates the object withnew ...
? Butdestroy() { delete this;}
is implemented inHeapOnly.cpp
and compiled into the shared library, thus trying to delete the object from a potentially different heap. I think this is no issue if both client and library are linked with the same run-time library, but this might not always be the case. Moving the implementation to the header should solve this.