Skip to content

Use persistent property in deferred IMGUI context-menu callbacks#66

Merged
VPDPersonal merged 1 commit into
feature/serialize-reference-dropdownfrom
fix/sr-imgui-menu-persistent-property
Jun 23, 2026
Merged

Use persistent property in deferred IMGUI context-menu callbacks#66
VPDPersonal merged 1 commit into
feature/serialize-reference-dropdownfrom
fix/sr-imgui-menu-persistent-property

Conversation

@VPDPersonal

Copy link
Copy Markdown
Owner

Summary

  • Fix three deferred GenericMenu callbacks in the IMGUI serialize-reference drawer that captured the stale per-frame property instead of the persistent snapshot the drawer already builds for the menu.
  • Create New Script…, Paste Template/*, and Link to Existing/* now read/write through persistent, so by click time they no longer dereference a SerializedObject that may have been disposed after the frame.

Notes for review

  • LinkTo reads its source via property.serializedObject.FindProperty(sourcePath) and writes back on the same SerializedObject; passing persistent keeps both sides on one live SO and preserves the shared managedReferenceId.
  • ApplyTemplate still calls property.Persistent() internally — now harmlessly idempotent since it receives an already-persistent property, and the deferred callback dereferences a live SO.

Linked issues

Refs #49 - addresses review finding #49 (comment)

@VPDPersonal VPDPersonal added type: fix Bug fix status: needs-review Ready for review area: editor Editor-only code labels Jun 21, 2026
@VPDPersonal VPDPersonal merged commit e22ed96 into feature/serialize-reference-dropdown Jun 23, 2026
1 check passed
@VPDPersonal VPDPersonal deleted the fix/sr-imgui-menu-persistent-property branch June 23, 2026 14:06
@github-actions github-actions Bot removed the status: needs-review Ready for review label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: editor Editor-only code type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant