Not necessarily so. Calling LApplication_Quit() from a
window's close handler is possible, but very close attention
should be paid to the chain of events that results from such
a call. In particular:
- An LApplication_Quit() call ultimately results in a CLOSE
message being sent to all open windows (including the one
that called LApplication_Quit() in the first place), therefore
an infinite LApplication_Quit() - WindowCloseHandler() loop is
a concrete possibility.
- If a close handler deallocates memory, or deletes widgets,
the second time it's called it may well end up using stale
pointers (resulting in a memory access fault).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=880582
Not necessarily so. Calling LApplication_Quit() from a
window's close handler is possible, but very close attention
should be paid to the chain of events that results from such
a call. In particular:
- An LApplication_Quit() call ultimately results in a CLOSE
message being sent to all open windows (including the one
that called LApplication_Quit() in the first place), therefore
an infinite LApplication_Quit() - WindowCloseHandler() loop is
a concrete possibility.
- If a close handler deallocates memory, or deletes widgets,
the second time it's called it may well end up using stale
pointers (resulting in a memory access fault).