diff options
| author | Juan Linietsky | 2018-06-08 19:21:26 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2018-06-08 19:21:26 -0300 |
| commit | e5b876e92a76a6521840ccda7bb16e49967fff8d (patch) | |
| tree | 2f5d753cb0a9fc28ea2725b7dd8369345004bc81 | |
| parent | 66871322b99436990daec5a70c09620619430b8d (diff) | |
| download | godot-e5b876e92a76a6521840ccda7bb16e49967fff8d.tar.gz godot-e5b876e92a76a6521840ccda7bb16e49967fff8d.tar.zst godot-e5b876e92a76a6521840ccda7bb16e49967fff8d.zip | |
| -rw-r--r-- | editor/animation_track_editor.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 9e06331e6..c37b31150 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -3873,6 +3873,12 @@ struct _AnimMoveRestore { void AnimationTrackEditor::_clear_key_edit() { if (key_edit) { + +#if 0 + // going back seems like the most comfortable thing to do, but it results + // in weird behaviors and crashes, because going back to animation editor + // triggers the editor setting up again itself + bool go_back = false; if (EditorNode::get_singleton()->get_inspector()->get_edited_object() == key_edit) { EditorNode::get_singleton()->push_item(NULL); @@ -3885,6 +3891,15 @@ void AnimationTrackEditor::_clear_key_edit() { if (go_back) { EditorNode::get_singleton()->get_inspector_dock()->go_back(); } +#else + //if key edit is the object being inspected, remove it first + if (EditorNode::get_singleton()->get_inspector()->get_edited_object() == key_edit) { + EditorNode::get_singleton()->push_item(NULL); + } + //then actually delete it + memdelete(key_edit); + key_edit = NULL; +#endif } } |
