by adde » Mar 12, 2003 @ 7:28am
First of all, I would like to point out that (as with almost all other operators) the delete [] can also be written as delete[].
Then, here's what I think is wrong with your code. -1073741819 is the same as 0xC0000005 which is the "access violation" error code. And since the debugger fails during a delete (This is why it asks for the dbgdel.cpp. It wants the debug information for the delete function.) there are two possible scenarios:
1. You are using threads and forgot to link your project to the MT version of the runtime library (CLIB). If the single thread version of the runtime library is used with multiple threads that use new and delete you will get race conditions since they will all use the same heap to allocate/deallocate memory. On my platform SDK for eVC however, I only have one library to link to (=CE Runtime) and I think it's the same for all WinCE platforms. This library is an MT library so this can't be the problem.
2. You used the pointer (or array) to write outside the allocated memory area. Sometimes the debugger doesn't report this as an access error until you try to delete the array and this is what I think happened.
So, take a close look at your code and double check every access to the array that caused the error. My bet is that you used an illegal array index somewhere.