Path: chuka.playstation.co.uk!news From: "Derek da Silva" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Codewarrior C++ Problem Date: Wed, 14 Mar 2001 16:57:42 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 65 Message-ID: <98o80u$ij82@www.netyaroze-europe.com> References: <985jdn$bmm4@www.netyaroze-europe.com> <985umo$bmm6@www.netyaroze-europe.com> <985vq7$bmm7@www.netyaroze-europe.com> <988bn5$g0m1@www.netyaroze-europe.com> NNTP-Posting-Host: usr1131-avo.cableinet.co.uk X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Hi Thanks for taking a look guys. I'm still looking for a neat solution for this problem. I thought about overloading new and delete so they use free and malloc so I avoid the bug in delete. I can overload delete but not delete[] (it won't compile). The code below works (so it is possible to overload delete), but I want to be able to overload delete[] as well. Can all you C++ gurus offer some advice? cheers Derek :-) #include #include #include void operator delete(void * p) { printf("z"); free(p); }; class gsCPoint { private: u_long x; u_long y; public: gsCPoint(); virtual ~gsCPoint(); }; gsCPoint::gsCPoint() { printf("c"); } gsCPoint::~gsCPoint() { printf("d"); } void quit(void); main() { gsCPoint *p; p = new gsCPoint; delete p; printf("end"); quit(); } asm void quit(void) { breakc 0x8201 nop }