tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] MacOS/Win10 An new additional WebviewWindow does not terminate its process and not release memory when closed.

Open Bukmopbl4 opened this issue 3 years ago • 1 comments

Describe the bug

After creating a new window according to the method from the APIs documentation, when it is closed, the process remains active and the allocated memory is not freed. If music was playing on the page, then it continues to play even after the window is closed.

const webview = new WebviewWindow('my-label', { url: 'https://github.com/tauri-apps/tauri' });

https://user-images.githubusercontent.com/19820469/195464919-2dedba15-737b-4e4f-9d18-2f1abcadf597.mp4

Reproduction

  1. Open DevTools from your App
  2. Use APIs for create new window from console new window.__TAURI__.window.WebviewWindow('my-label', { url: 'https://github.com/tauri-apps/tauri' });
  3. Close the window
  4. The window process remains in the task manager. If the opened page had a sound accompaniment, then the music continues to play even after the window is closed.

Expected behavior

I expected a complete closure with the release of the occupied memory and the termination of the process in the same way as with the complete closure of the entire program.

Platform and versions

[email protected] tauri tauri

Environment › OS: Mac OS 12.6.0 X64 › Node.js: 16.17.1 › npm: 8.15.0 › pnpm: Not installed! › yarn: Not installed! › rustup: 1.25.1 › rustc: 1.64.0 › cargo: 1.64.0 › Rust toolchain: stable-x86_64-apple-darwin

Packages › @tauri-apps/cli [NPM]: 1.1.1 › @tauri-apps/api [NPM]: Not installed! › tauri [RUST]: 1.1.1, › tauri-build [RUST]: 1.1.1, › tao [RUST]: 0.14.0, › wry [RUST]: 0.21.1,

App › build-type: bundle › CSP: unset › distDir: ../src › devPath: ../src

App directory structure ├─ node_modules ├─ src-tauri ├─ .vscode └─ src

Stack trace

No response

Additional context

No response

Bukmopbl4 avatar Oct 12 '22 23:10 Bukmopbl4

Yes indeed - I hadn't really noticed up till now but I get the same using MacOS (12.6). The subwindow processes will remain alive despite the actual windows closing. The app needs to exit to close all the processes.

Blatman avatar Oct 16 '22 08:10 Blatman

still present on new version 1.2

Bukmopbl4 avatar Nov 08 '22 17:11 Bukmopbl4

Sounds like https://github.com/tauri-apps/wry/issues/536 is back 🤔

FabianLars avatar Nov 08 '22 17:11 FabianLars

I think yes. Part of the memory is not released, the sounds continue to play in the background without a window.

Bukmopbl4 avatar Nov 08 '22 21:11 Bukmopbl4

I am also experiencing something similar but just on windows.

Sytten avatar Nov 10 '22 22:11 Sytten

Fixed in https://github.com/tauri-apps/wry/pull/754. Will be part of the next Wry release.

FabianLars avatar Nov 13 '22 19:11 FabianLars

fixed with wry version v0.22.1

Bukmopbl4 avatar Nov 16 '22 19:11 Bukmopbl4