From b66b86b05eca3b557700d0249fc3874099056638 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 18 Apr 2015 19:06:58 -0300 Subject: [PATCH] -Fixed post-import script-reload buf, fixes #1683 --- core/reference.cpp | 4 ++++ core/reference.h | 1 + .../editor/io_plugins/editor_scene_import_plugin.cpp | 12 +++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/core/reference.cpp b/core/reference.cpp index adae07ce31..509e132b5a 100644 --- a/core/reference.cpp +++ b/core/reference.cpp @@ -59,6 +59,10 @@ void Reference::_bind_methods() { ObjectTypeDB::bind_method(_MD("unreference"),&Reference::unreference); } +int Reference::reference_get_count() const { + return refcount.get(); +} + void Reference::reference(){ refcount.ref(); diff --git a/core/reference.h b/core/reference.h index 54838e0570..544da41044 100644 --- a/core/reference.h +++ b/core/reference.h @@ -53,6 +53,7 @@ public: bool init_ref(); void reference(); bool unreference(); + int reference_get_count() const; Reference(); ~Reference(); diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp index 7228ab611f..f9715cb332 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp @@ -714,7 +714,8 @@ void EditorSceneImportDialog::_import(bool p_and_open) { } - Ref pi; + + if (script_path->get_text()!="") { Ref