| | |
How to immediately terminate program in C++
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2008
Posts: 10
Reputation:
Solved Threads: 0
Hello!
When my program in C++ exits, it throws errors like:
EInvalidPinter with message 'Invalid Pointer operation' ...
and later:
EAccessViolation with mesage 'Access violation at address 00000010 ...
and finally:
Abonarmal Program Termination
I can't locate the code responsible for it ( I am using many libraries in my program). I think that it's coused by some destructor (or uncalled destructor).
It appers only when I exit the program, and does not affect program work.
Is there a way to immediately terminate the program (without errors), so the memory would have to be freed by operating system?
When my program in C++ exits, it throws errors like:
EInvalidPinter with message 'Invalid Pointer operation' ...
and later:
EAccessViolation with mesage 'Access violation at address 00000010 ...
and finally:
Abonarmal Program Termination
I can't locate the code responsible for it ( I am using many libraries in my program). I think that it's coused by some destructor (or uncalled destructor).
It appers only when I exit the program, and does not affect program work.
Is there a way to immediately terminate the program (without errors), so the memory would have to be freed by operating system?
You really need to fix the problem instead of trying to hid it.Try commenting out large blocks of code until the program no longer produces those errors. That will narrow down your search for the problem.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
Join Date: Feb 2008
Posts: 630
Reputation:
Solved Threads: 46
If the problem is indeed in a library and you not doing anything incorrectly, maybe try exit(0) (from stdlib) as the last line of the program? I don't know if that would help? It would be nice if you could kind of find where it happens though so you could report the problem to the mailing list/forum for that library.
Dave
Dave
> It appers only when I exit the program, and does not affect program work.
You mean it doesn't affect it YET.
Memory corruption problems move around the code over time (as you continue to make changes to the code).
All of a sudden, you could find it happens at some much more obvious and inconvenient point in the code (say save file).
If your regular debugger isn't providing much help, then try WinDbg
http://www.microsoft.com/whdc/devtoo...g/default.mspx
You mean it doesn't affect it YET.
Memory corruption problems move around the code over time (as you continue to make changes to the code).
All of a sudden, you could find it happens at some much more obvious and inconvenient point in the code (say save file).
If your regular debugger isn't providing much help, then try WinDbg
http://www.microsoft.com/whdc/devtoo...g/default.mspx
>>All of a sudden, you could find it happens at some much more obvious and
>>inconvenient point in the code (say save file).
LoL, so true
>>inconvenient point in the code (say save file).
•
•
•
•
Murphy's Law for Computer programming: A program with undefined behavior(or ill defined behavior) will continue to work in all debugging session and will halt when a extremely important transaction is going on (for example a billion dollar deal).
Siddhant Sanyam
(Not posting much)
Migrate to Standard C++ :When to tell your C++ Code is Non-Standard.
Please Read before posting: How To Ask Questions The Smart Way
(Not posting much)
Migrate to Standard C++ :When to tell your C++ Code is Non-Standard.
Please Read before posting: How To Ask Questions The Smart Way
•
•
Join Date: May 2009
Posts: 22
Reputation:
Solved Threads: 5
•
•
•
•
35nando:
When my program in C++ exits, it throws errors like:
EInvalidPinter with message 'Invalid Pointer operation' ...
and later:
EAccessViolation with mesage 'Access violation at address 00000010 ...
and finally:
Abonarmal Program Termination
whatever that allocates something to a pointer, and
doesn't use free() or the like, it results to "invalid pointer operation" and "violation at address 00000010".
Allocate to a pointer and deallocate it if unused.
If this is not the case, recheck your constructors with its destructors.
![]() |
Similar Threads
- GDI information please (Advertising Sales Strategies)
- Terminate the program... (C)
- How to terminate program? (C++)
- Help C++ my program!!! (C++)
- c++ program help pls.... urgent (C++)
- Please point me in the right way for the ending of my C program. (C)
- How do you Terminate an Infinite Loop? Impossible!!! (C++)
- Program won't run (Windows NT / 2000 / XP)
- Only 1 instance of program (Java)
- Phonebook program help (C++)
Other Threads in the C++ Forum
- Previous Thread: c++ server (corba communication)
- Next Thread: list file
| Thread Tools | Search this Thread |
api array arrays based beginner binary c++ c/c++ calculator char class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news number output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






