Re: allocates something in one dll and then deallocates it in main
exe
On Jul 21, 1:46 pm, Ron <ron.nata...@gmail.com> wrote:
On Jul 21, 6:27 am, DDD <1983...@gmail.com> wrote:
After runtime come out test() function, there will be an
error. From callback heap view, I see the error comes from
vector destruct function. Is it because myObject will
reallocate object which allocate in a.dll?
This has nothing to do with C++. It has entirely to do with
the fact that each Microsoft Visual Studio runtime library has
it's own allocation data, so if you have modules linked
against different runtime libraries you can't deallocate in
one that what was allocated in another.
It has nothing to do with C++, because C++ doesn't define DLL's.
But VC++ doesn't have this problem if you link correctly; if
you're using DLL's, you need either -MD or -MDd (normally, the
latter, except in extreme cases).
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34