Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

The BrowserViews are not getting destroyed after closing the BrowserWindow #653

Open
msynk opened this issue May 19, 2022 · 2 comments
Open

Comments

@msynk
Copy link

msynk commented May 19, 2022

Currently, the clear method of the ViewManager class is using the Object.values method on the views list which is a Map as follows:

image

since the Object.values does not work on a Map and returns an empty array, the views are not getting destroyed.
(just try Object.values(new Map([['a', {a:1}], ['b', {b:2}]])) in the console)

for example, if you have multiple windows open and in one of them a video is playing, after closing that window the video keeps playing until the app is closed.

@msynk
Copy link
Author

msynk commented May 19, 2022

I'm not sure why the Object.values method is used in this line, but the fix is simply to remove it and use the forEach method on the this.views itself, something like this:

this.views.forEach((x: View) => x.destroy())

if it's ok I can create a new PR for this change 😊

@msynk
Copy link
Author

msynk commented May 19, 2022

there are some other usages of the Object.values the same way, that I think have the same problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant