Panics and the CleanupStack
| Tue, 2005-03-01 13:27 | |
|
Hi all
Im wondering what happens to memory allocated on the heap after a panic has occured. If a panic might occur, should we then add allocated objects to the cleanup stack before attempting to do the thing that could panic the app. Will the os attempt to destoy items on the cleanupstack after a panic? Thanks ![]() |
|







Forum posts: 22
Contrary to 99% of 3rd party software, error conditions that Leave can actually be dealt with and mitigated - it is termed "graceful degradation". If you have an untrapped leave, ultimately that becomes a panic.
A panic does completely clear the resources (e.g. memory) of the panicked app. So don't worry about it!
(Unless you override the default panic handler, and then all bets are off.)
Forum posts: 6
Im aware that the cleanup stack is a mechanism to clean up after a leave - I jst speculated about whether to worry about 3rd party external code that might panic unexpectedly and thereby orpahane memory i've allocated . But that doesnt seem to be something to worry about.