that is the equivalent of doing this
- Code: Select all
malloc (100);
exit(0);
you will leave a memory leak behind
if you want to do that you will need to install an
int atexit( void (__cdecl *func )( void ));
function callback that let you call destroy. eieth that oy you cna comment out the assert, in dgGlobalAllocator()
I would not recomned that since you will them not knwo if you have leacks.
the proper way to handle this , I believe, is by installing and atexit() callback.
better yet is not to use exit() at all.
exit is a very all faction and draconian programming style, that date from, the unstructure days of C.
clean code should not use exit() and at exit() under any circuntances.
also what do you mean "I don't want the user to have to delete every world when exiting the program."
if you exit a program all memory should be reclaimed.
if the application does not do graciuoslly, the OS will do it for you nastilly. Basically your app will stay there for a long time while the OS is tracking all dangling memory allocations.