I have a dialog box with two exit options.
In the first, I free all memory taken by my operations, then call CDialog::OnOk(). It passes smoothly and with no problems.
In the second, I free all memory taken, just as above and with the same commands, and then call exit(0). I need this because this is a 2nd-level dialog and I want to give the user the opportunity to quit the application immediately, without having to return him to the calling 1st-level dialog.
However, this exit(0) causes a memory leak: nothing serious, less than 100 bytes but still it's a nuisance. So, the question is actually two questions:
1) What does CDialog::OnOk() do to free memory that exit(0) doesn't do?
2) Is there any Windows-style function to replace the DOS-style exit(0) function?