2
0
Эх сурвалжийг харах

Change shutdown order when detecting external destruction of debugger documents

This is not allowed, however, we still test this situation in the unit tests, and it caused a crash when running on Emscripten.

This commit changes the shutdown order so that the debugger documents are released before emitting the log message. This prevents the log call from calling back into the debugger and eventually leading to a crash in `ElementLog::AddLogMessage`.
Michael Ragazzon 1 жил өмнө
parent
commit
894b72cf1c

+ 1 - 1
Source/Debugger/DebuggerPlugin.cpp

@@ -225,9 +225,9 @@ void DebuggerPlugin::OnElementDestroy(Element* element)
 	// `Context::UnloadAllDocuments()` on the host context.
 	if (element == menu_element || element == info_element || element == log_element)
 	{
+		ReleaseElements();
 		Log::Message(Log::LT_ERROR,
 			"A document owned by the Debugger plugin was destroyed externally. This is not allowed. Consider shutting down the debugger instead.");
-		ReleaseElements();
 	}
 
 	if (info_element)