Skip to content

GH-1183 Fix engine freeze when Skeleton3DEditor is Deleted#1220

Open
JoltedJon wants to merge 1 commit intoRedot-Engine:masterfrom
JoltedJon:GH-1183
Open

GH-1183 Fix engine freeze when Skeleton3DEditor is Deleted#1220
JoltedJon wants to merge 1 commit intoRedot-Engine:masterfrom
JoltedJon:GH-1183

Conversation

@JoltedJon
Copy link
Contributor

@JoltedJon JoltedJon commented Mar 8, 2026

fixes #1183

Before the Skeleton3DEditor is freed it will cause the editor to iterate through every bone and call _update_properties this operation is expensive and takes ~1500 microseconds per call. On skeletons with many bones this will cause a noticeable freeze of the engine. This change will prevent _update_properties from being called on deletion.

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced the 3D skeleton editor to handle skeleton deletion operations more reliably, preventing visual glitches and editor instability that previously occurred during the deletion process.

@coderabbitai
Copy link

coderabbitai bot commented Mar 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2bbc6d39-a6e4-4214-be78-d12748757a01

📥 Commits

Reviewing files that changed from the base of the PR and between 7ff8093 and cd5746c.

📒 Files selected for processing (2)
  • editor/scene/3d/skeleton_3d_editor_plugin.cpp
  • editor/scene/3d/skeleton_3d_editor_plugin.h

Walkthrough

Added a deletion guard (is_deleting flag) to Skeleton3DEditor that skips property updates during the editor deletion flow, preventing UI/gizmo updates on a partially torn-down editor instance.

Changes

Cohort / File(s) Summary
Skeleton3DEditor Deletion Guard
editor/scene/3d/skeleton_3d_editor_plugin.h, editor/scene/3d/skeleton_3d_editor_plugin.cpp
Added private boolean is_deleting member initialized to false; set to true in _notification on NOTIFICATION_PREDELETE; causes _update_properties to short-circuit and return early when flag is active.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • PR #1179 — Also modifies Skeleton3DEditor's deletion/notification handling to clear editor references during cleanup.

Suggested labels

bug, regression

Suggested reviewers

  • Arctis-Fireblight
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding a deletion guard to fix the engine freeze issue in Skeleton3DEditor, which is the primary objective of the PR.
Linked Issues check ✅ Passed The code changes implement the core fix for issue #1183 by preventing _update_properties from being called during editor deletion, directly addressing the freeze caused by expensive per-bone operations.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the linked issue #1183, introducing only a deletion guard flag and guard logic in the update method without extraneous modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Open

Development

Successfully merging this pull request may close these issues.

Skeleton3D Editor Slowdown

2 participants