PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

C++ operator new #define question

Hi.

I'm building a project and running it in visualc++ 6.0 and running it on the pc. gapiapplication.h #defines operator new to use _CLIENT_BLOCK. This causes a problem when i call delete because delete assumes _NORMAL_BLOCK. For example:

int* f = new int;
delete f;

fails because it malloc's with _CLIENT_BLOCK and then later fails by calling free with _NORMAL_BLOCK instead of client block. Has anyone else run into this?

-David
cottrelld · 10 Jun 2003, 19:39 UTC — changed header
Well I went ahead and modified my own gapiapplication.h, but I have to believe other people run into the same thing when building a non mfc project in visual c++?

-David
Hm. None of the sample applications use MFC.. What did you change ?
cottrelld · 11 Jun 2003, 06:48 UTC — what I changed
I removed the #defines overriding new in GapiApplication.h

I'm not using MFC, and the #ifdefs for when there's no mfc set up a section overriding new and including <CrtDbg.h> I left the include but removed the new override.

-David