Skip to content

fix: HasWorldReference.onRemove() should call super.onRemove()#3920

Open
Miiohau wants to merge 6 commits into
flame-engine:mainfrom
Miiohau:fixing-HasWorldReference.onRemove()-doesn't-call-super.onRemove()
Open

fix: HasWorldReference.onRemove() should call super.onRemove()#3920
Miiohau wants to merge 6 commits into
flame-engine:mainfrom
Miiohau:fixing-HasWorldReference.onRemove()-doesn't-call-super.onRemove()

Conversation

@Miiohau
Copy link
Copy Markdown

@Miiohau Miiohau commented May 13, 2026

added @mustCallSuper on Component "lifecycle methods" (including onParentResize) to be consisted with onGameResize

added super.onRemove(); to HasWorldReference.onRemove()

Description

Fixes #3919
Makes HasWorldReference.onRemove() call super.onRemove() and added @mustCallSuper on Component "lifecycle methods" to to help similar bugs to be detected

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Fixes #3919

…rentResize) to be consisted with onGameResize

added super.onRemove(); to HasWorldReference.onRemove()
@spydon spydon changed the title fix:HasWorldReference.onRemove() doesn't call super.onRemove() fix: HasWorldReference.onRemove() doesn't call super.onRemove() May 13, 2026
@spydon spydon changed the title fix: HasWorldReference.onRemove() doesn't call super.onRemove() fix: HasWorldReference.onRemove() should call super.onRemove() May 13, 2026
Copy link
Copy Markdown
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, it's a bit weird to add mustCallSuper to all the empty lifecycle methods in Component since they don't implement anything, but I get the thinking. I'll take that up with the team.

Tests are missing that shows that the bug has been solved (so that we don't have a regression later).

@spydon
Copy link
Copy Markdown
Member

spydon commented May 13, 2026

@Miiohau can you limit this PR to only the changes in has_world.dart, and add @mustCallSuper on the onRemove there?

Miiohau added 4 commits May 13, 2026 21:51
…onParentResize) to be consisted with onGameResize
…onParentResize) to be consisted with onGameResize

added test
…e()-doesn't-call-super.onRemove()' into fixing-HasWorldReference.onRemove()-doesn't-call-super.onRemove()
@Miiohau
Copy link
Copy Markdown
Author

Miiohau commented May 14, 2026

Reverted the @mustCallSuper changes and added a test.

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.

HasWorldReference.onRemove() doesn't call super.onRemove()

2 participants