diff options
author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2021-01-06 20:25:05 +0100 |
---|---|---|
committer | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2021-01-06 23:40:50 +0100 |
commit | 6fbe0a494b9945f7adcc8603ebfbfeb040f718ba (patch) | |
tree | 1deb0db29e89cb1ca37e8834e5d089fe876390dc /editor/inspector_dock.cpp | |
parent | 8158d17edf18e3d6ec847d2cb710012361e7b12e (diff) | |
download | redot-engine-6fbe0a494b9945f7adcc8603ebfbfeb040f718ba.tar.gz |
Fix cases of resources destroyed too early
Diffstat (limited to 'editor/inspector_dock.cpp')
-rw-r--r-- | editor/inspector_dock.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 311fa5206e..fbcd76a95f 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -270,14 +270,13 @@ void InspectorDock::_select_history(int p_idx) { } void InspectorDock::_resource_created() { - Object *c = new_resource_dialog->instance_selected(); + Variant c = new_resource_dialog->instance_selected(); ERR_FAIL_COND(!c); Resource *r = Object::cast_to<Resource>(c); ERR_FAIL_COND(!r); - REF res(r); - editor->push_item(c); + editor->push_item(r); } void InspectorDock::_resource_selected(const RES &p_res, const String &p_property) { |