godotengine / godotengine/godot

Editor crash when deleting animation from SpriteFrames window after clearing resource without focus

Open
#112,576 3 comments 0 reactions 0 assignees View on GitHub
bug crash topic:animation topic:editor
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

**Versions Affected**: 4.4 ~ 4.5.1 (reproducible)
- v4.5.stable.mono.official [876b29033]
- v4.5.1.stable.official [f62fdbde1]

*Note: Due to network limitations, I was unable to test other versions. Apologies for the inconvenience.*

### System information

- **OS**: Windows 10 (build 19045)
- **Godot**: v4.5.stable.mono
- **Graphics**: NVIDIA GeForce GTX 1050 Ti (NVIDIA; 32.0.15.7652) - OpenGL 3 (Compatibility)
- **CPU**: 13th Gen Intel(R) Core(TM) i5-13400F (16 threads)
- **RAM**: 15.83 GiB
- **Display**: Multi-window, 1 monitor

### Issue description

Hello Godot team,

I'm a Godot 4 developer from China. While working on my project, I encountered a critical issue related to the AnimatedSprite2D node where certain operations on the `sprite_frames` property cause the editor to crash.

**Expected Behavior**

After clearing the `sprite_frames` resource, the SpriteFrames editor window should either:
- Close automatically, or
- Clear its content and display an appropriate message about the missing resource

**Actual Behavior**

The SpriteFrames window remains open after resource deletion, and any interaction with it causes an editor crash.

**Additional Notes**
- I searched using relevant keywords but didn't find similar reported issues
- This is 100% reproducible following the steps above
- Minimal reproduction project: Not applicable (reproducible in any project)

### Steps to reproduce

1. Create an `AnimatedSprite2D` node
2. Create a new `SpriteFrames` resource for the `sprite_frames` property and click to edit it (this opens the SpriteFrames editor window)
3. *(Optional)* Perform some operations in the SpriteFrames window (adding animations, setting frames) - these don't affect the outcome
4. At this point, focus is on the `sprite_frames` property (indicated by blue highlighting). To reproduce the issue, we need to remove this focus
5. Click on any other node or area in the screen to make the AnimatedSprite2D node lose focus (the SpriteFrames window will close automatically)
6. Now click again on the AnimatedSprite2D node - the SpriteFrames window reopens, but notice that the `sprite_frames` property no longer has focus (black text, not blue)
7. Right-click the `sprite_frames` property and select "Clear" - the SpriteFrames resource is deleted (if you had set default animation frames, the 2D view will update correctly), but the SpriteFrames window remains open with unchanged content
8. Finally, click either the "Delete Animation" button or the "New Animation" button in the SpriteFrames window - the Godot editor crashes immediately

**Key Observation**

The crash occurs specifically when clearing the `sprite_frames` property while it doesn't have focus. If the property has focus when cleared, the SpriteFrames window closes properly and no crash occurs.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with AnimatedSprite2D and the SpriteFrames window using the eight steps in the report, especially clearing sprite_frames without focus. Trace the SpriteFrames editor's handling of the cleared resource; done means the window closes or clears safely and clicking New Animation or Delete Animation no longer crashes the editor.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.