Browse Source

Remove AnimatedSprite pointer when clearing editor

kobewi 1 year ago
parent
commit
55f7d493ee
1 changed files with 2 additions and 1 deletions
  1. 2 1
      editor/plugins/sprite_frames_editor_plugin.cpp

+ 2 - 1
editor/plugins/sprite_frames_editor_plugin.cpp

@@ -1322,8 +1322,9 @@ void SpriteFramesEditor::_edit() {
 void SpriteFramesEditor::edit(Ref<SpriteFrames> p_frames) {
 void SpriteFramesEditor::edit(Ref<SpriteFrames> p_frames) {
 	_update_stop_icon();
 	_update_stop_icon();
 
 
-	if (!p_frames.is_valid()) {
+	if (p_frames.is_null()) {
 		frames.unref();
 		frames.unref();
+		_remove_sprite_node();
 		hide();
 		hide();
 		return;
 		return;
 	}
 	}