BACKENDS: Improve safety of Modular Backend Destructor And Close _fsFactory Memory Leak

Since the modular backend implements abstract modules to be written in the future which _may_ have interdependencies, they should be set to null pointers after deletion. 

This allows assert(_eventManager) type lines to work, which would have detected bug #3121841 without a segfault...

Also, _fsFactory should be deleted to ensure it is not leaked though this causes a group of GCC warnings and probably should be done in a different manner.

svn-id: r54580
This commit is contained in:
David Turner 2010-11-29 18:22:31 +00:00
parent 0e90a2a808
commit 91a6b7f537

View File

@ -40,13 +40,22 @@ ModularBackend::ModularBackend()
}
ModularBackend::~ModularBackend() {
delete _fsFactory;
_fsFactory = 0;
delete _graphicsManager;
_graphicsManager = 0;
delete _eventManager;
_eventManager = 0;
delete _mixer;
_mixer = 0;
delete _audiocdManager;
_audiocdManager = 0;
delete _savefileManager;
_savefileManager = 0;
delete _timerManager;
_timerManager = 0;
delete _mutexManager;
_mutexManager = 0;
}
bool ModularBackend::hasFeature(Feature f) {