File tree Expand file tree Collapse file tree
crates/tauri-runtime-wry/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ tauri-runtime-wry : patch:bug
3+ ---
4+
5+ On Linux, keep the WebContext alive to prevent zombie WebKit processes after repeatedly closing all windows and re-opening them.
Original file line number Diff line number Diff line change @@ -2422,6 +2422,18 @@ impl Drop for WebviewWrapper {
24222422 if let Some ( web_context) = context_store. get_mut ( & self . context_key ) {
24232423 web_context. referenced_by_webviews . remove ( & self . label ) ;
24242424
2425+ // https://github.com/tauri-apps/tauri/issues/14626
2426+ // Because WebKit does not close its network process even when no webviews are running,
2427+ // we need to ensure to re-use the existing process on Linux by keeping the WebContext
2428+ // alive for the lifetime of the app.
2429+ // WebKit on macOS handles this itself.
2430+ #[ cfg( not( any(
2431+ target_os = "linux" ,
2432+ target_os = "dragonfly" ,
2433+ target_os = "freebsd" ,
2434+ target_os = "netbsd" ,
2435+ target_os = "openbsd"
2436+ ) ) ) ]
24252437 if web_context. referenced_by_webviews . is_empty ( ) {
24262438 context_store. remove ( & self . context_key ) ;
24272439 }
You can’t perform that action at this time.
0 commit comments