diff --git a/src-tauri/src/commands/media.rs b/src-tauri/src/commands/media.rs index 6574fcc22..2dcf99640 100644 --- a/src-tauri/src/commands/media.rs +++ b/src-tauri/src/commands/media.rs @@ -125,6 +125,8 @@ pub async fn close_mpv_process( process_id: u32, app_handle: tauri::AppHandle, ) -> Result<(), String> { + #[cfg(windows)] + return Err("Process termination is not supported on Windows".to_string()); if let Some(process) = MPV_PROCESSES.lock().unwrap().remove(&process_id) { #[cfg(unix)] { @@ -133,17 +135,6 @@ pub async fn close_mpv_process( } } - #[cfg(windows)] - { - unsafe { - let handle = OpenProcess(PROCESS_TERMINATE, 0, process_id); - if !handle.is_null() { - TerminateProcess(handle, 1); - CloseHandle(handle); - } - } - } - // Updated event emission app_handle .emit("mpv-process-removed", process)