Re: Error in plex.cpp, line 44
-
Hello, I'm receiving a windows message box (actual name of EXE omitted): First-chance exception in ______.exe: 0xC0000005: Access Violation Possible deallocation error? Any other ideas what the problem may be? Any help is appreciated. The disassembly code is shown below (crash at line 44).
38: void CPlex::FreeDataChain() // free this one and links
39: {
00479931 test ecx,ecx
00479933 je CPlex::FreeDataChain+15h (00479946)
00479935 push esi
40: CPlex* p = this;
41: while (p != NULL)
42: {
43: BYTE* bytes = (BYTE*) p;
44: CPlex* pNext = p->pNext;
00479936 mov esi,dword ptr [ecx]
45: delete[] bytes;
00479938 push ecx
00479939 call operator delete (0047f53d)
0047993E pop ecx
0047993F test esi,esi
46: p = pNext;
00479941 mov ecx,esi
00479943 jne CPlex::FreeDataChain+5 (00479936)
00479945 pop esi
47: }
48: }Regards, Mike
-
Hello, I'm receiving a windows message box (actual name of EXE omitted): First-chance exception in ______.exe: 0xC0000005: Access Violation Possible deallocation error? Any other ideas what the problem may be? Any help is appreciated. The disassembly code is shown below (crash at line 44).
38: void CPlex::FreeDataChain() // free this one and links
39: {
00479931 test ecx,ecx
00479933 je CPlex::FreeDataChain+15h (00479946)
00479935 push esi
40: CPlex* p = this;
41: while (p != NULL)
42: {
43: BYTE* bytes = (BYTE*) p;
44: CPlex* pNext = p->pNext;
00479936 mov esi,dword ptr [ecx]
45: delete[] bytes;
00479938 push ecx
00479939 call operator delete (0047f53d)
0047993E pop ecx
0047993F test esi,esi
46: p = pNext;
00479941 mov ecx,esi
00479943 jne CPlex::FreeDataChain+5 (00479936)
00479945 pop esi
47: }
48: }Regards, Mike
Either the caller provied a bad
this
(but non-NULL) pointer or the linked list structure is corrupt.Steve
-
Hello, I'm receiving a windows message box (actual name of EXE omitted): First-chance exception in ______.exe: 0xC0000005: Access Violation Possible deallocation error? Any other ideas what the problem may be? Any help is appreciated. The disassembly code is shown below (crash at line 44).
38: void CPlex::FreeDataChain() // free this one and links
39: {
00479931 test ecx,ecx
00479933 je CPlex::FreeDataChain+15h (00479946)
00479935 push esi
40: CPlex* p = this;
41: while (p != NULL)
42: {
43: BYTE* bytes = (BYTE*) p;
44: CPlex* pNext = p->pNext;
00479936 mov esi,dword ptr [ecx]
45: delete[] bytes;
00479938 push ecx
00479939 call operator delete (0047f53d)
0047993E pop ecx
0047993F test esi,esi
46: p = pNext;
00479941 mov ecx,esi
00479943 jne CPlex::FreeDataChain+5 (00479936)
00479945 pop esi
47: }
48: }Regards, Mike
Looking at this piece of code, i got the shivers. :omg: Well it is MFC code so I shouldn't be surprised. Use the call stack to get back to get to your code where the real problem probably occurred. Check for already delete of freed up chunks of memory.
codito ergo sum
-
Hello, I'm receiving a windows message box (actual name of EXE omitted): First-chance exception in ______.exe: 0xC0000005: Access Violation Possible deallocation error? Any other ideas what the problem may be? Any help is appreciated. The disassembly code is shown below (crash at line 44).
38: void CPlex::FreeDataChain() // free this one and links
39: {
00479931 test ecx,ecx
00479933 je CPlex::FreeDataChain+15h (00479946)
00479935 push esi
40: CPlex* p = this;
41: while (p != NULL)
42: {
43: BYTE* bytes = (BYTE*) p;
44: CPlex* pNext = p->pNext;
00479936 mov esi,dword ptr [ecx]
45: delete[] bytes;
00479938 push ecx
00479939 call operator delete (0047f53d)
0047993E pop ecx
0047993F test esi,esi
46: p = pNext;
00479941 mov ecx,esi
00479943 jne CPlex::FreeDataChain+5 (00479936)
00479945 pop esi
47: }
48: }Regards, Mike