[Scummvm-devel] Re: Freeing resources on quit
Ruediger Hanke
tomjoad at muenster.de
Sun Oct 6 13:27:08 CEST 2002
> I don't quite understand where the problem is, as we already have a
> quit() method in the system interface. Why can't you just change the
> remaining parts that call exit() to use the system->quit() method
> instead?
I've set up an atexit() routine already, so I could do it there ... if
you can tell me how I can get the mididriver object from the SimonState
MidiPlayer there. I need to call close() on the midi driver. AFAIK, there's no
global variable containing the SimonState.
> As for freeing all resources, that is tricky with the current
> approach (which relays on the OS being "clever" enough to free all
> occupied resources when the program terminates).
A matter of attitude ... personally, I consider it a bad programming
habit. Resource tracking in an OS should not be an excuse for lazy
programming, C++ is not Java ... but this is not my project so it'll
be fine with me as long as there's some stupid way to close the mididriver.
RĂ¼diger
--
"...wherever there's somebody fightin' for a place to stand
Or a decent job or a helping hand
Wherever somebody's struggling to be free
Look in their eyes Mom you'll see me."
- Bruce Springsteen, "The Ghost of Tom Joad"
More information about the Scummvm-devel
mailing list