Skip to content

Commit

Permalink
fix: Fix memory leak from user script handler
Browse files Browse the repository at this point in the history
Closes #920.
  • Loading branch information
dpogue committed Aug 14, 2024
1 parent 93f208c commit 6835944
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,14 @@ - (void)pluginInitialize
NSLog(@"Using WKWebView");
}

- (void)dispose
{
WKWebView* wkWebView = (WKWebView*)_engineWebView;
[wkWebView.configuration.userContentController removeScriptMessageHandlerForName:CDV_BRIDGE_NAME];

[super dispose];
}

- (void) onAppWillEnterForeground:(NSNotification*)notification {
if ([self shouldReloadWebView]) {
NSLog(@"%@", @"CDVWebViewEngine reloading!");
Expand Down

0 comments on commit 6835944

Please sign in to comment.