id summary reporter owner description type status priority component version resolution keywords cc game 5533 SCUMMVM: Crash on exit Templier "{{{#!Markdown Since the opengl branch merge, ScummVM crashes on exit. The EventManager is deleted in ModularBackend before the GraphicManager \(and the pointer not set to NULL\), so in the SdlGraphicManager, the call to the eventManager makes it crash. scummvm.exe\!Common::EventDispatcher::unregisterObserver\(Common::EventObserver \* obs\) Line 119 + 0x8 bytes C++ scummvm.exe\!SdlGraphicsManager::~SdlGraphicsManager\(\) Line 204 C++ scummvm.exe\!SdlGraphicsManager::\`scalar deleting destructor'\(\) + 0x2b bytes C++ scummvm.exe\!ModularBackend::~ModularBackend\(\) Line 44 + 0x37 bytes C++ scummvm.exe\!OSystem\_SDL::~OSystem\_SDL\(\) Line 97 + 0x8 bytes C++ scummvm.exe\!OSystem\_Win32::~OSystem\_Win32\(\) + 0x2b bytes C++ scummvm.exe\!OSystem\_Win32::\`scalar deleting destructor'\(\) + 0x2b bytes C++ scummvm.exe\!SDL\_main\(int argc, char \* \* argv\) Line 61 + 0x36 bytes C++ scummvm.exe\!WinMain\(HINSTANCE\_\_ \* \_\_formal, HINSTANCE\_\_ \* \_\_formal, HINSTANCE\_\_ \* \_\_formal, HINSTANCE\_\_ \* \_\_formal\) Line 42 + 0x12 bytes C++ scummvm.exe\!\_\_tmainCRTStartup\(\) Line 275 + 0x2c bytes C scummvm.exe\!WinMainCRTStartup\(\) Line 189 C kernel32.dll\!75923677\(\) \[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll\] ntdll.dll\!77c19d42\(\) ntdll.dll\!77c19d15\(\) Swapping the two delete calls in ModularBackend destructor seems to fix it for me. Erik Torbjorn seems to have the same problem and had to do one more step to get rid of the valgrind warnings: ""The shortest set of changes I can find that gets rid of the Valgrind warnings is to swap the order of ""delete \_eventManager;"" and ""delete \_graphicsManager;"" i ModularBackend::~ModularBackend\(\), and remove SDL\_Quit\(\) from OSystem\_SDL::~OSystem\_SDL\(\). But that last one doesn't feel right."" }}} {{{#!div style=""font-size: 75%"" Ticket imported from: !#3121841. Ticket imported from: bugs/5533. }}}" defect closed normal Engine: SCUMM fixed