I have a fairly large legacy application, which uses only normal pointers. Right now I am adding a new module, trying to use "more modern stuff", e.g. smart pointers.
The main module sends a message over a communication DLL to my new submodule (with a normal pointer). In my new submodule I am using shared_pointer for message handling. When the shared pointer tries to delete the pointer, I get an access violation in the dectructor of the message, because VTable pointer is 0xdddddddd. I have already found this SO question , which says this is because the pointer has already been released.
It seems the main module is already deleting the normal pointer, before shared pointer deletes it.
I don't want to use shared pointers in the old main module (would be very much refactoring at this point), but is there a solution how I can use both normal and shared pointers in my application? The usual NULL check in the destructor does not help.