Quellcode durchsuchen

Removed finalizer from GUIPanel as it was causing a crash
Ensured that EditorWidget contents get properly cleaned up when it closes

Marko Pintera vor 11 Jahren
Ursprung
Commit
3c2cecaf48

+ 2 - 1
BansheeEditor/Source/BsEditorWidget.cpp

@@ -19,7 +19,8 @@ namespace BansheeEngine
 
 
 	EditorWidgetBase::~EditorWidgetBase()
 	EditorWidgetBase::~EditorWidgetBase()
 	{
 	{
-
+		if (mContent != nullptr)
+			GUIArea::destroy(mContent);
 	}
 	}
 
 
 	void EditorWidgetBase::close()
 	void EditorWidgetBase::close()

+ 9 - 1
BansheeMono/Source/BsMonoManager.cpp

@@ -8,6 +8,7 @@
 #include <mono/metadata/assembly.h>
 #include <mono/metadata/assembly.h>
 #include <mono/metadata/mono-config.h>
 #include <mono/metadata/mono-config.h>
 #include <mono/metadata/mono-gc.h>
 #include <mono/metadata/mono-gc.h>
+#include <mono/metadata/mono-debug.h>
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
@@ -17,7 +18,14 @@ namespace BansheeEngine
 	MonoManager::MonoManager()
 	MonoManager::MonoManager()
 		:mRootDomain(nullptr), mScriptDomain(nullptr), mIsCoreLoaded(false)
 		:mRootDomain(nullptr), mScriptDomain(nullptr), mIsCoreLoaded(false)
 	{
 	{
-		mono_set_dirs(MONO_LIB_DIR.c_str(), MONO_ETC_DIR.c_str()); 
+		mono_set_dirs(MONO_LIB_DIR.c_str(), MONO_ETC_DIR.c_str());
+
+#if BS_DEBUG_MODE
+		mono_set_signal_chaining(true);
+		mono_debug_init(MONO_DEBUG_FORMAT_MONO);
+#endif
+
+		
 		mono_config_parse(nullptr);
 		mono_config_parse(nullptr);
 
 
 		mRootDomain = mono_jit_init_version("BansheeMono", "v4.0.30319"); // TODO: Allow user-defined version here?
 		mRootDomain = mono_jit_init_version("BansheeMono", "v4.0.30319"); // TODO: Allow user-defined version here?

+ 1 - 1
BansheeMono/Source/BsMonoMethod.cpp

@@ -24,7 +24,7 @@ namespace BansheeEngine
 		::MonoMethod* virtualMethod = mono_object_get_virtual_method(instance, mMethod);
 		::MonoMethod* virtualMethod = mono_object_get_virtual_method(instance, mMethod);
 
 
 		MonoObject* exception = nullptr;
 		MonoObject* exception = nullptr;
-		MonoObject* retVal = mono_runtime_invoke(virtualMethod, instance, params, nullptr);
+		MonoObject* retVal = mono_runtime_invoke(virtualMethod, instance, params, &exception);
 
 
 		MonoUtil::throwIfException(exception);
 		MonoUtil::throwIfException(exception);
 		return retVal;
 		return retVal;

+ 5 - 9
Inspector.txt

@@ -3,20 +3,16 @@ Update GUIFoldout with sub styles
 
 
 Test if drag and dropping scene objects works with object and resource fields. Especially custom resources and components.
 Test if drag and dropping scene objects works with object and resource fields. Especially custom resources and components.
 
 
-Test clone method in SerializableProperty
-
-There an error on exit with GUI, likely due to new destruction scheme. I will likely need to adjust C# code so it marks all children as destroyed when parent is destroyed.
+Restore widget layout save/load methods
+Fix issue that happens when GUI element is destroyed and tries to access a previously deleted object
+Fix unreleased core objects
+Restore other commented out managed code
+Get InspectorWindow to show up in main window again
 
 
 Test custom resources:
 Test custom resources:
  - Can I load them? (Will likely need ProjectLIbrary::load)
  - Can I load them? (Will likely need ProjectLIbrary::load)
  - Can I reference them in Component and will the reference be held after after cloning?
  - Can I reference them in Component and will the reference be held after after cloning?
 
 
-ARRAY
-> MyArray    [_________] [Resize]
-   1. [_________] [X] [C] [^] [¡]
-   2. [_________] [X] [C] [^] [¡]
-   3. [_________] [X] [C] [^] [¡]
-
 ARRAY TODO:
 ARRAY TODO:
  - Ensure that case when array is null is handled properly. Will likely need a [Create] button. And a [Clear] button?
  - Ensure that case when array is null is handled properly. Will likely need a [Create] button. And a [Clear] button?
  - Need a GUIFoldout that doesn't have BG and is just a single button.
  - Need a GUIFoldout that doesn't have BG and is just a single button.

+ 0 - 9
MBansheeEngine/GUI/GUIPanel.cs

@@ -23,15 +23,6 @@ namespace BansheeEngine
             Internal_CreateInstance(this);
             Internal_CreateInstance(this);
         }
         }
 
 
-        ~GUIPanel()
-        {
-            GUIArea[] childArray = childAreas.ToArray(); // Iterating over it will modify it so make a copy
-            for (int i = 0; i < childArray.Length; i++)
-                childArray[i].Destroy();
-
-            childAreas.Clear();
-        }
-
         internal void Initialize()
         internal void Initialize()
         {
         {
             mainArea = AddArea(0, 0, 0, 0);
             mainArea = AddArea(0, 0, 0, 0);