Well Exiting your application with removing data is really, really BAD! Can cause mem leaks.
Anyway so you would need to delete your level, libs, or anything before closing down.
For example:
int end_game(lua_State *L)
{
ode.Stop();
lua_close(L);
dbEnd();
exit(1);
return 1;
}
Don't mind the function name and such...
But when I destroy the app, before doing that I destroy the physics object, lua, and dargdk itself. Before calling that function I call another function to delete my last used level containing all objects, and such, altough it seams that that is not really imporant.
Good luck with your project, and
merry c++mas.