Fix editor crash on "save and exit" bug

If a scene is modified and a user closes the editor and selects the "Save
and exit" option in the modal dialog -- the editor crashes. This appears
to be a result of the message queue being memdeleted AFTER visual servers
have been destroyed. Remnant textures handled by the message queue throw a
NRE when their own ~Texture destructors reference the visual servers.

This fixes bugs: #12946 and #12813.
This commit is contained in:
Chong-U Lim 2017-12-20 08:34:04 +00:00
parent b08735f209
commit 0f223783dc
1 changed files with 1 additions and 0 deletions

View File

@ -1871,6 +1871,7 @@ void Main::cleanup() {
if (engine) if (engine)
memdelete(engine); memdelete(engine);
message_queue->flush();
memdelete(message_queue); memdelete(message_queue);
unregister_core_driver_types(); unregister_core_driver_types();