Browse Source

Clear up contexts before shutting down plugins, as some elements may reference the plugin.

Michael Ragazzon 6 years ago
parent
commit
ee669494ee
2 changed files with 4 additions and 3 deletions
  1. 3 2
      Source/Core/Core.cpp
  2. 1 1
      Source/Debugger/Plugin.cpp

+ 3 - 2
Source/Core/Core.cpp

@@ -104,11 +104,12 @@ bool Initialise()
 
 void Shutdown()
 {
+	// Clear out all contexts, which should also clean up all attached elements.
+	contexts.clear();
+
 	// Notify all plugins we're being shutdown.
 	PluginRegistry::NotifyShutdown();
 
-	contexts.clear();
-
 	TemplateCache::Shutdown();
 	StyleSheetFactory::Shutdown();
 	StyleSheetSpecification::Shutdown();

+ 1 - 1
Source/Debugger/Plugin.cpp

@@ -230,7 +230,7 @@ void Plugin::OnContextDestroy(Core::Context* context)
 		ReleaseElements();
 
 		Geometry::SetContext(nullptr);
-		context = nullptr;
+		host_context = nullptr;
 	}
 }