Fix crash in texture previeer, closes #26749, probably others

This commit is contained in:
Juan Linietsky 2019-03-08 14:17:37 -03:00
parent 241a85de7c
commit 95c6d9caba
2 changed files with 6 additions and 0 deletions

View file

@ -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) {

View file

@ -50,6 +50,7 @@ protected:
public:
void edit(Ref<Texture> p_texture);
TextureEditor();
~TextureEditor();
};
class EditorInspectorPluginTexture : public EditorInspectorPlugin {