Ticket #52 (closed defect)

Opened 8 years ago

Last modified 8 years ago

Memory checking error

Reported by: walky_one Owned by:
Priority: normal Milestone:
Component: wxMSW Version:
Keywords: Cc: walky_one, vadz
Blocked By: Patch: no
Blocking:

Description

I just can't allocate anything on the heap without getting an assertion fault when I delete it again.

Assert happens in Function
void operator delete(void* pUserData)
(it's in file msvc\crt\src\dbgdel.cpp)
on line 47:
_ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse));

I don't know exactly why it happens. Tried around and always the same:
Take a sample (I took docview), add the following two lines anywhere in the project (I did in constructor of MyApp, the application object. So it will be executed right at the start):

int* pInt = new int;
delete pInt;

compile and run.....
As soon as delete get's called, my app crashes.
Anyone a idea or a way around?

btw: my system:
Win95,
MSDEV 6.0 with VC6.0
service pack I'm not sure, probably 1.....
application version nr: 6.0.0.0.0626 (1033)
And I'm trying the whole thing with using dll's....

Thanks for helping me

Change History

Changed 8 years ago by walky_one

OK, searched some more hours, here's the solution:
Problem is that with standard settings the wxWindows source for operator new, but the msvc source for operator delete is called...... which results in an assertion fault (who wonders)

my solution is to turn off wxWindows memory checking (setup.h flag
#define wxUSE_GLOBAL_MEMORY_OPERATORS 0

now it works well.....
still not really a nice feature.....

Daniel Bernhard

Changed 8 years ago by anonymous

This problem is addresed in latest sources.
Especially note change in memory.h -r1.28.
What wx rel do you use ?

Changed 8 years ago by vadz

with standard settings this doesn't happen to the best of my knowledge, so yours must be non standard...

Note: See TracTickets for help on using tickets.