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

Even if I delete it, WebView (or other?) remains. #536

Closed
1 of 2 tasks
tasuren opened this issue Mar 30, 2022 · 6 comments · Fixed by #547 or #586
Closed
1 of 2 tasks

Even if I delete it, WebView (or other?) remains. #536

tasuren opened this issue Mar 30, 2022 · 6 comments · Fixed by #547 or #586

Comments

@tasuren
Copy link

tasuren commented Mar 30, 2022

Describe the bug
Let's say you have a program that creates a window to play videos.
And when I created multiple of them and then deleted some, the video in the browser that I had deleted would still be playing.

Steps To Reproduce
Prepare code of wry/examples/multi_window.rs.
Add a below snipet (YouTube embed) to here str.

<iframe class="background" id="background" 
src="https://www.youtube.com/embed/JUGHD_YWOe4?iv_load_policy=3&amp;loop=1&amp;playlist=JUGHD_YWOe4&amp;control=0&amp;fs=0&amp;mute=On&amp;end=111&amp;modestbranding=1&amp;start=11&amp;autoplay=1" 
frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; 
picture-in-picture" allowfullscreen="" style="width: 1191px; height: 678px;"></iframe>

Create about five windows every almost few seconds.
After a while, when it gets too noisy, close the window a little at a time and try to get only one.
Then it remains noisy.
So the closed window is still in motion.

Expected behavior
To be successfully closed.

Screenshots
Nothing

Platform and Versions (please complete the following information):
OS: macOS 12.3
Rustc: 1.59.0

Would you assign yourself to resolve this bug?

  • Yes
  • No

Additional context
Nothing

@keiya01
Copy link
Member

keiya01 commented Apr 21, 2022

This case seems to occur on MacOS 👀

@keiya01
Copy link
Member

keiya01 commented Apr 21, 2022

And I could reproduce this issue on MacOS.

@ahkohd
Copy link
Member

ahkohd commented May 8, 2022

Will this help? https://stackoverflow.com/questions/21161406/freeing-ios-uiwebview-resources-after-usage

-(void) dealloc
{

    [self.webview cleanForDealloc];
    self.webview = nil;
    [super dealloc];

}

@FabianLars
Copy link
Member

FabianLars commented May 8, 2022

I think it's this one: https://stackoverflow.com/questions/58454042/wkwebview-instances-and-memory-leak

I tried to test it, but i can't get obj-c to cooperate with me 😂

On that note i'm going to re-open this issue because we're leaking memory right now because of this.

@FabianLars FabianLars reopened this May 8, 2022
@FabianLars FabianLars added the priority: high Vital to have label May 11, 2022
keiya01 added a commit to keiya01/wry that referenced this issue May 15, 2022
@keiya01
Copy link
Member

keiya01 commented May 15, 2022

I try to fix this issue based on #536 (comment).
I would appreciate if you review #587 🙏

@keiya01
Copy link
Member

keiya01 commented May 15, 2022

Also maybe we need to remove WKWebsiteDataStore by using removeDataOfTypes.

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

Successfully merging a pull request may close this issue.

5 participants