Skip to content

[MEDIUM] verification delayCall can mutate the editor after the window is closed #136

Description

@Daliys

Problem

MCPVerificationWindow schedules verification work through an anonymous EditorApplication.delayCall and does not cancel it if the window is closed before it runs.

Evidence

  • Editor/MCPVerificationWindow.cs:71-83 disables UI and adds an anonymous delayed callback.
  • The callback calls RunVerification(), which performs editor mutations through JSON-RPC verification steps.
  • There is no OnDisable cleanup or retained delegate to unsubscribe.

Impact

A user can close the verification window after scheduling, but the verification still runs and mutates scenes/assets without visible UI context.

Suggested fix

Store the callback delegate, remove it in OnDisable, and check this/window lifetime before running editor mutations.

Source report

Imported from audit report item: unity-antipattern (6) / Editor/MCPVerificationWindow.cs:77.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageImported or reported issue awaiting owner reviewpriority: mediumImportant defect or workflow gap with workaroundsurface: diagnosticsDiagnostics, verification, log capture, and troubleshooting workflowssurface: unity-editorUnity Editor package, windows, menus, or C# server surfacetype: unity-antipatternUnity Editor lifecycle, Undo, selection, or API usage antipattern

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions