RE: [GD-Windows] new/delete across DLL's
Brought to you by:
vexxed72
From: Brian H. <bri...@py...> - 2003-03-24 19:17:10
|
>Repeat after me: Factories. Interfaces. Bliss. :-) Just to be clear, you're saying this is bad: foo *f =3D Foo::newFoo(); delete f; but that this is good: foo *f =3D Foo::newFoo(); Foo::deleteFoo(f); ? >Un-balanced allocations/deletions really are a bad idea for a >variety of reasons; this being just one. Well, a big part of me pretty much blames the language, but= that's a bit too convenient given that Microsoft's DLL idiosyncracies seem= to be rather unique in the world of operating systems (although you= do point out some interesting cases on Unix). This is one reason why overloading global operator new seems like= a pipe dream in everything but the most specific cases (e.g. I can= get away with it because I don't use DLLs for anything on Windows --= but I can't get away with it at all using GCC for various reasons I= never bothered to figure out). Brian |