fix(macos): avoid double disposing mpv core

This commit is contained in:
edde746
2026-05-03 10:59:30 +02:00
parent aa3c83bad1
commit 060926b749
@@ -7,6 +7,7 @@ class MpvPlayerCore: MpvPlayerCoreBase {
private weak var window: NSWindow?
private var playbackActivity: NSObjectProtocol?
private var layerHiddenForOcclusion = false
private var isDisposed = false
func initialize(in window: NSWindow) -> Bool {
guard !isInitialized else {
@@ -170,6 +171,9 @@ class MpvPlayerCore: MpvPlayerCoreBase {
}
func dispose() {
if isDisposed { return }
isDisposed = true
endPlaybackActivity()
NotificationCenter.default.removeObserver(self)
disposeSharedState(destroySynchronously: false)