summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorJuan Linietsky <juan@godotengine.org>2019-03-08 14:17:37 -0300
committerJuan Linietsky <juan@godotengine.org>2019-03-08 14:18:12 -0300
commit95c6d9cabace69901bc8e7f93ad611577fe89b74 (patch)
tree4c3c3dfa2acee2812909ae06887b02655635ebf1 /editor/plugins
parent241a85de7c9628864c1d4fd609d6425b370b82f2 (diff)
Fix crash in texture previeer, closes #26749, probably others
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/texture_editor_plugin.cpp5
-rw-r--r--editor/plugins/texture_editor_plugin.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp
index 6f9c9fa040..0aa4a7662c 100644
--- a/editor/plugins/texture_editor_plugin.cpp
+++ b/editor/plugins/texture_editor_plugin.cpp
@@ -138,6 +138,11 @@ TextureEditor::TextureEditor() {
set_custom_minimum_size(Size2(1, 150));
}
+TextureEditor::~TextureEditor() {
+ if (!texture.is_null()) {
+ texture->remove_change_receptor(this);
+ }
+}
//
bool EditorInspectorPluginTexture::can_handle(Object *p_object) {
diff --git a/editor/plugins/texture_editor_plugin.h b/editor/plugins/texture_editor_plugin.h
index 9c7d33df5a..bcbda1fbd7 100644
--- a/editor/plugins/texture_editor_plugin.h
+++ b/editor/plugins/texture_editor_plugin.h
@@ -50,6 +50,7 @@ protected:
public:
void edit(Ref<Texture> p_texture);
TextureEditor();
+ ~TextureEditor();
};
class EditorInspectorPluginTexture : public EditorInspectorPlugin {