Skip to content

Reliably dispose of ConsoleWidget when entering play mode#10442

Open
ElmarTalibzade wants to merge 2 commits intoFacepunch:masterfrom
ElmarTalibzade:fix/issue-10440
Open

Reliably dispose of ConsoleWidget when entering play mode#10442
ElmarTalibzade wants to merge 2 commits intoFacepunch:masterfrom
ElmarTalibzade:fix/issue-10440

Conversation

@ElmarTalibzade
Copy link
Copy Markdown

@ElmarTalibzade ElmarTalibzade commented Apr 10, 2026

Pull Request

Summary

If you had "Clear Console On Play" enabled, you'd get the below, public facing error:

Error calling event 'scene.startplay' on 'Editor.ConsoleWidget'

But this is the actual error that's being tossed around:

QPlainTextEdit was null when calling clear

I believe it's caused because ConsoleWidget wasn't being propely disposed of.

Motivation & Context

Fixes: #10440

Implementation Details

The fix was straightforward, I made sure that ConsoleWidget singleton instance was being properly disposed when OnDestroyed callback is called.

I snooped around and got inspired by how it was already done in the codebase - mainly in MainAssetBrowser (source) and SceneNetworkSystem (source).

I also spotted that Sandbox.ActionGraphs using directive was unused so I nuked it.

Screenshots / Videos (if applicable)

This is the error message people would be seeing in master at the present.

image

Checklist

  • Code follows existing style and conventions
  • No unnecessary formatting or unrelated changes
  • Public APIs are documented (if applicable)
  • Unit tests added where applicable and all passing
  • I’m okay with this PR being rejected or requested to change 🙂

@ElmarTalibzade ElmarTalibzade marked this pull request as ready for review April 10, 2026 23:02
@ElmarTalibzade ElmarTalibzade changed the title Fixed an issue when ConsoleWidget would try clearing of a disposed … Reliably dispose of ConsoleWidget when entering play mode Apr 10, 2026
@ElmarTalibzade ElmarTalibzade changed the title Reliably dispose of ConsoleWidget when entering play mode Reliably dispose of ConsoleWidget when entering play mode Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Getting Error calling event 'scene.startplay' on 'Editor.ConsoleWidget' when Console window is closed

1 participant