summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-06-13 10:10:50 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-06-13 10:10:50 -0300
commit7f02627290cedf2d5ef6b45cddc6117c763cb15b (patch)
treee25e3f1a33e63a941732c8e920908c3e20bab113 /tools
parentf0abda999e179faf1577026d0369062349cb4897 (diff)
-Add visible IO errors when closing a file fails due to it being locked (most likely on windows), closes #4760
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/editor_node.cpp9
-rw-r--r--tools/editor/editor_node.h1
2 files changed, 8 insertions, 2 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index b90b017f53..2e8bf0f311 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -217,7 +217,7 @@ void EditorNode::_notification(int p_what) {
if (p_what==NOTIFICATION_EXIT_TREE) {
editor_data.save_editor_external_data();
-
+ FileAccess::set_file_close_fail_notify_callback(NULL);
log->deinit(); // do not get messages anymore
}
if (p_what==NOTIFICATION_PROCESS) {
@@ -5138,6 +5138,10 @@ void EditorNode::_dropped_files(const Vector<String>& p_files,int p_screen) {
EditorImportExport::get_singleton()->get_import_plugin(i)->import_from_drop(p_files,cur_path);
}
}
+void EditorNode::_file_access_close_error_notify(const String& p_str) {
+
+ add_io_error("Unable to write to file '"+p_str+"', file in use, locked or lacking permissions.");
+}
void EditorNode::_bind_methods() {
@@ -5233,7 +5237,6 @@ EditorNode::EditorNode() {
SceneState::set_disable_placeholders(true);
editor_initialize_certificates(); //for asset sharing
-
InputDefault *id = Input::get_singleton()->cast_to<InputDefault>();
if (id) {
@@ -6575,6 +6578,7 @@ EditorNode::EditorNode() {
_load_docks();
+ FileAccess::set_file_close_fail_notify_callback(_file_access_close_error_notify);
}
@@ -6582,6 +6586,7 @@ EditorNode::EditorNode() {
EditorNode::~EditorNode() {
+
memdelete( EditorHelp::get_doc_data() );
memdelete(editor_selection);
memdelete(editor_plugins_over);
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h
index 65a5687dce..7023c6c174 100644
--- a/tools/editor/editor_node.h
+++ b/tools/editor/editor_node.h
@@ -574,6 +574,7 @@ private:
void _update_addon_config();
+ static void _file_access_close_error_notify(const String& p_str);
protected:
void _notification(int p_what);