Re: [GD-Windows] new/delete across DLL's
Brought to you by:
vexxed72
From: Pierre T. <p.t...@wa...> - 2003-03-24 19:40:17
|
>Just to be clear, you're saying this is bad: > >foo *f = Foo::newFoo(); >delete f; > >but that this is good: > >foo *f = Foo::newFoo(); >Foo::deleteFoo(f); Definitely. Exactly what Javier said. I ran into a ridiculously high amount of nasty bugs in Flexporter, because of this issue. (MAX + MFC + my own engine in multiple DLLs, inlining all the time, overring new/delete, mixing various versions of MSVCRT => blam ! blam! more blam!) Factories, factories, and some more factories. Don't even try fighting it, you'll only regret it later ........ :) Note that BoundsChecker usually detects the new/delete mismatch (and blame you rightfully). - Pierre www.codercorner.com |