c++ - Pure virtual destructor in interface -
This is my problem. I'm making C ++ DLL, which is largely dependent on exporting the example object, so I I send my real examples back as an interface through some exported factory method.
The interfaces I use are completely virtual, so I also need a pure virtual constructor, and I applied one (with empty body, as I did it google). All are thoroughly prepared, except ... I can not see if real killers have been called or not - because when I did something like
std :: cout & lt; & Lt; "Hello Destructor";I never get to see it.
I have some obvious "obj" (edit: and it is called "free object" inside DLL), it is not the problem.
Am I missing something? Is there another way to delete my object through the interface?
EDIT: Again, I do not have memory management inconsistency, it's all within DLL but the right destroyer does not start right now.
You should not match and should not match new
and < Code> Delete on DLL borders
Instead, I tried and suggested that I use COM: AddRef
and release
. When the reference count is zero, release
call delete it;
From within the DLL, make sure that new
and delete
are matching.
Comments
Post a Comment