فهرست منبع

Fixed a crash due to a localized string finalizer being called twice

BearishSun 10 سال پیش
والد
کامیت
1fd09a0d22
3فایلهای تغییر یافته به همراه7 افزوده شده و 12 حذف شده
  1. 1 1
      MBansheeEditor/ToolbarItem.cs
  2. 3 11
      SBansheeEditor/Source/BsToolbarItemManager.cpp
  3. 3 0
      TODO.txt

+ 1 - 1
MBansheeEditor/ToolbarItem.cs

@@ -58,7 +58,7 @@ namespace BansheeEditor
         private string name;
         private string name;
         private string icon;
         private string icon;
         private int builtinIcon;
         private int builtinIcon;
-        private LocString tooltip;
+        private string tooltip;
         private int priority;
         private int priority;
         private bool separator;
         private bool separator;
     }
     }

+ 3 - 11
SBansheeEditor/Source/BsToolbarItemManager.cpp

@@ -11,8 +11,6 @@
 #include "BsMainEditorWindow.h"
 #include "BsMainEditorWindow.h"
 #include "BsGUIMenuBar.h"
 #include "BsGUIMenuBar.h"
 #include "BsGUIContent.h"
 #include "BsGUIContent.h"
-#include "BsScriptSpriteTexture.h"
-#include "BsScriptHString.h"
 #include "BsBuiltinEditorResources.h"
 #include "BsBuiltinEditorResources.h"
 #include "BsProjectLibrary.h"
 #include "BsProjectLibrary.h"
 
 
@@ -133,17 +131,11 @@ namespace BansheeEngine
 			icon = static_resource_cast<SpriteTexture>(ProjectLibrary::instance().load(texturePath));
 			icon = static_resource_cast<SpriteTexture>(ProjectLibrary::instance().load(texturePath));
 		}
 		}
 
 
-		MonoObject* tooltipMono;
+		MonoString* tooltipMono;
 		mTooltipField->getValue(toolbarItemAttrib, &tooltipMono);
 		mTooltipField->getValue(toolbarItemAttrib, &tooltipMono);
 
 
-		if (tooltipMono == nullptr)
-			tooltip = HString::dummy();
-		else
-		{
-			ScriptHString* tooltipScript = ScriptHString::toNative(tooltipMono);
-			tooltip = tooltipScript->getInternalValue();
-		}
-		
+		tooltip = HString(MonoUtil::monoToWString(tooltipMono));
+
 		mPriorityField->getValue(toolbarItemAttrib, &priority);
 		mPriorityField->getValue(toolbarItemAttrib, &priority);
 		mSeparatorField->getValue(toolbarItemAttrib, &separator);
 		mSeparatorField->getValue(toolbarItemAttrib, &separator);
 
 

+ 3 - 0
TODO.txt

@@ -165,6 +165,9 @@ parameter solves the problem (presumably boxing the return value would also work
 Sometimes exceptions cause a crash in Event, although this is due to an exception triggering a dialog box which triggers
 Sometimes exceptions cause a crash in Event, although this is due to an exception triggering a dialog box which triggers
 the message loop and causes another exception. Make sure to look for the original exception.
 the message loop and causes another exception. Make sure to look for the original exception.
 
 
+Finalizers on attribute members will get called more than once. This causes issues if some of the members reference native 
+objects as already deleted native objects will try to be deleted again. 
+
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 MenuItem
 MenuItem