Просмотр исходного кода

tools: do not ask twice whether to save the level

Daniele Bartolini 5 лет назад
Родитель
Сommit
0e7929fde2
2 измененных файлов с 6 добавлено и 3 удалено
  1. 1 0
      docs/changelog.rst
  2. 5 3
      tools/level_editor/level_editor.vala

+ 1 - 0
docs/changelog.rst

@@ -12,6 +12,7 @@ Changelog
 **Tools**
 
 * Added the ability to select from a number of templates (samples) when creating new projects
+* Fixed an issue that caused the Level Editor to ask multiple times whether save the level in some circumnstances
 
 **Lua API**
 

+ 5 - 3
tools/level_editor/level_editor.vala

@@ -832,11 +832,10 @@ public class LevelEditorApplication : Gtk.Application
 
 	public void restart_backend(string source_dir, string level_name)
 	{
+		string sd = source_dir.dup();
+		string ln = level_name.dup();
 		stop_backend();
 
-		string sd = source_dir;
-		string ln = level_name;
-
 		// Reset project state.
 		_placeable_type = "";
 		_placeable_name = "";
@@ -923,6 +922,9 @@ public class LevelEditorApplication : Gtk.Application
 		stop_game();
 		stop_editor();
 		stop_data_compiler();
+
+		_level.reset();
+		_project.reset();
 	}
 
 	private void stop_data_compiler()