Browse Source

Debugger plugin: Remove boolean return result from shutdown procedure, update comments.

Michael Ragazzon 3 years ago
parent
commit
a07bee248c
3 changed files with 13 additions and 11 deletions
  1. 6 4
      Include/RmlUi/Debugger/Debugger.h
  2. 4 5
      Source/Debugger/Debugger.cpp
  3. 3 2
      changelog.md

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

@@ -38,13 +38,15 @@ class Context;
 namespace Debugger {
 namespace Debugger {
 
 
 /// Initialises the debug plugin. The debugger will be loaded into the given context.
 /// Initialises the debug plugin. The debugger will be loaded into the given context.
-/// @param[in] context The RmlUi context to load the debugger into. The debugging tools will be displayed on this context. If this context is destroyed, the debugger will be released.
+/// @param[in] host_context RmlUi context to load the debugger into. The debugging tools will be displayed on this context. If this context is
+///     destroyed, the debugger will be released.
 /// @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* host_context);
 
 
 /// Shuts down the debugger.
 /// Shuts down the debugger.
-/// @return True if the debugger was successfully shut down
-RMLUIDEBUGGER_API bool Shutdown();
+/// @note The debugger is automatically shutdown during the call to Rml::Shutdown(), calling this is only necessary to shutdown the debugger early
+///     or to re-initialize the debugger on another host context.
+RMLUIDEBUGGER_API void 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.

+ 4 - 5
Source/Debugger/Debugger.cpp

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

+ 3 - 2
changelog.md

@@ -38,6 +38,7 @@ The `<textarea>` and `<input type="text">` elements have been improved in severa
 - Fixed an issue where Windows newline endings (\r\n) would produce an excessive space character.
 - Fixed an issue where Windows newline endings (\r\n) would produce an excessive space character.
 - Fixed operation of page up/down numpad keys being swapped.
 - Fixed operation of page up/down numpad keys being swapped.
 - The input method editor (IME) is now positioned at the caret during text editing on the Windows backend. #303 #305 (thanks @xland)
 - The input method editor (IME) is now positioned at the caret during text editing on the Windows backend. #303 #305 (thanks @xland)
+- Fix slow input handling especially with CJK input on the Win32 backend. #311
 
 
 ### Lua plugin
 ### Lua plugin
 
 
@@ -51,13 +52,13 @@ The `<textarea>` and `<input type="text">` elements have been improved in severa
 ### General fixes
 ### General fixes
 
 
 - `<img>` element: Fix wrong dp-scaling being applied when an image is cloned through a parent element. #310
 - `<img>` element: Fix wrong dp-scaling being applied when an image is cloned through a parent element. #310
-- Win32 backend: Fix slow input handling especially with CJK input. #311
 - Logging a message without an installed system interface will now be written to cout instead of crashing the application.
 - Logging a message without an installed system interface will now be written to cout instead of crashing the application.
+- Fixed a crash when the debugger plugin was shutdown manually. #322 #323 (thanks @LoneBoco)
 
 
 ### Breaking changes
 ### Breaking changes
 
 
 - Changed the signature of the keyboard activation in the system interface, it now passes the caret position and line height: `SystemInterface::ActivateKeyboard(Rml::Vector2f caret_position, float line_height)`.
 - Changed the signature of the keyboard activation in the system interface, it now passes the caret position and line height: `SystemInterface::ActivateKeyboard(Rml::Vector2f caret_position, float line_height)`.
-
+- Removed the boolean result returned from `Rml::Debugger::Shutdown()`.
 
 
 ## RmlUi 4.4
 ## RmlUi 4.4