Browse Source

Add Rml::Debugger::Shutdown

Lucien Catonnet 4 years ago
parent
commit
71b9284a80
2 changed files with 18 additions and 0 deletions
  1. 4 0
      Include/RmlUi/Debugger/Debugger.h
  2. 14 0
      Source/Debugger/Debugger.cpp

+ 4 - 0
Include/RmlUi/Debugger/Debugger.h

@@ -42,6 +42,10 @@ namespace Debugger {
 /// @return True if the debugger was successfully initialised
 /// @return True if the debugger was successfully initialised
 RMLUIDEBUGGER_API bool Initialise(Context* context);
 RMLUIDEBUGGER_API bool Initialise(Context* context);
 
 
+/// Shuts down the debugger.
+/// @return True if the debugger was successfully shut down
+RMLUIDEBUGGER_API bool Shutdown();
+
 /// Sets the context to be debugged.
 /// Sets the context to be debugged.
 /// @param[in] context The context to be debugged.
 /// @param[in] context The context to be debugged.
 /// @return True if the debugger is initialised and the context was switched, false otherwise.
 /// @return True if the debugger is initialised and the context was switched, false otherwise.

+ 14 - 0
Source/Debugger/Debugger.cpp

@@ -57,6 +57,20 @@ bool Initialise(Context* context)
 	return true;
 	return true;
 }
 }
 
 
+// Shuts down the debugger.
+bool Shutdown()
+{
+	DebuggerPlugin* plugin = DebuggerPlugin::GetInstance();
+	if(plugin == nullptr) {
+		Log::Message(Log::LT_WARNING, "Unable to shutdown debugger plugin, it was not initialised!");
+		return false;
+	}
+
+	UnregisterPlugin(plugin);
+
+	return true;
+}
+
 // Sets the context to be debugged.
 // Sets the context to be debugged.
 bool SetContext(Context* context)
 bool SetContext(Context* context)
 {
 {