Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseGameArea sticks in memory after undocking #376

Closed
Loomie opened this issue Mar 21, 2021 · 2 comments
Closed

BaseGameArea sticks in memory after undocking #376

Loomie opened this issue Mar 21, 2021 · 2 comments
Assignees
Labels
bug Bugs within the program
Projects

Comments

@Loomie
Copy link

Loomie commented Mar 21, 2021

Describe the bug
After looking in a heap dump of our Zircon application I found a no longer shown GameArea (and its references). The problem is that Cobalt is not used properly 馃槢 In BaseGameArea.init an onChange listener is registered. But it is never unregistered! So the EventBus of Cobalt holds that listener forever. That listener has a reference to the GameArea and therefore to our own code.

To Reproduce

screen.dock(viewWithGameArea)
screen.dock(otherView)

Do a garbage collection (GC) and create a heap dump.

Expected behavior
No instance of the no longer used View should linger in the memory.

Screenshots
gcroot

Desktop (please complete the following information):

  • Version org.hexworks.zircon:zircon.core-jvm:2020.2.0-RELEASE

Additional context
Add any other context about the problem here.

@Loomie
Copy link
Author

Loomie commented Mar 21, 2021

Created PR #377 with a proposed fix.

@adam-arold adam-arold added the bug Bugs within the program label Apr 6, 2021
@adam-arold adam-arold added this to Backlog in Zircon via automation Apr 6, 2021
adam-arold added a commit that referenced this issue Apr 6, 2021
Make GameArea Disposable (fixes #376)
Zircon automation moved this from Backlog to Done Apr 6, 2021
@adam-arold adam-arold added this to the 2021.1.0-RELEASE milestone Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs within the program
Projects
Zircon
  
Done
Development

No branches or pull requests

3 participants