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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resize listener is referenced to remove it at dispose #2016

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

valentinMachado
Copy link
Contributor

Description

In View class the resize listener is referenced, to remove it at dispose

Motivation and Context

This change allow to well dispose a View, and to allow GC to collect View disposed.

@jailln
Copy link
Contributor

jailln commented Mar 6, 2023

Thanks! Does this solves #1936 ? Have you compared memory snapshots before and after removing the view before and after your changes?

@valentinMachado
Copy link
Contributor Author

Thanks! Does this solves #1936 ? Have you compared memory snapshots before and after removing the view before and after your changes?

I don't know but before this change when a view was disposed the resize listener was still called, meaning the view was still referenced and thus not garbage collected (meaning everything referenced by the view such as layers I guess was not garbage collected, it could solves #1936 or be part of the fix).

In our use case https://github.com/VCityTeam/UD-Imuv we are creating and disposing many PlanarView, what point me this issue was that after some create/dispose a warning was pointing that there were too many webgl context created.

I am still going to investigate this and will check memory snapshot after many create/dispose of a view (VCityTeam/UD-Imuv#410).

@jailln
Copy link
Contributor

jailln commented Mar 6, 2023

It doesn't fixes #1936 but it is still a good fix. Can you rename your commit to follow the angular convention please ? Then we can merge

@valentinMachado
Copy link
Contributor Author

It doesn't fixes #1936 but it is still a good fix. Can you rename your commit to follow the angular convention please ? Then we can merge

it would have been too simple ^^
done :)

@jailln jailln merged commit 6f4ec34 into iTowns:master Mar 6, 2023
@valentinMachado valentinMachado deleted the fix-resize-dispose-Core-View branch March 6, 2023 12:22
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.

2 participants