mirror of https://github.com/mpv-player/mpv
mac/remote: remove make current observer when stopped
the observer is registered on every call of the start function. this could lead to several registered observers for the same event and several calls to the make current function, even though we only need it once per event. properly remove the observer on stop, so we only ever have one observer registered.
This commit is contained in:
parent
de36f11fa8
commit
07a3bf0365
|
@ -124,6 +124,12 @@ class RemoteCommandCenter: NSObject {
|
|||
|
||||
infoCenter.nowPlayingInfo = nil
|
||||
infoCenter.playbackState = .unknown
|
||||
|
||||
NotificationCenter.default.removeObserver(
|
||||
self,
|
||||
name: NSApplication.willBecomeActiveNotification,
|
||||
object: nil
|
||||
)
|
||||
}
|
||||
|
||||
@objc func makeCurrent(notification: NSNotification) {
|
||||
|
|
Loading…
Reference in New Issue