mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-10 05:44:16 +00:00
possible fix for crash on media_change event (#581)
This commit is contained in:
parent
367c9d902d
commit
c713afe574
1 changed files with 6 additions and 1 deletions
|
@ -113,7 +113,10 @@ bool g_media_events = false;
|
|||
|
||||
- (void)media_change:(NSNotification *)notification {
|
||||
if (!g_media_events) return;
|
||||
MRMediaRemoteGetNowPlayingApplicationDisplayName(0, dispatch_get_main_queue(), ^(CFStringRef name) {
|
||||
MRMediaRemoteGetNowPlayingApplicationDisplayName(0, dispatch_get_main_queue(), ^(CFStringRef name_nr) {
|
||||
if (!name_nr) return;
|
||||
|
||||
CFStringRef name = CFStringCreateCopy(CFAllocatorGetDefault(), name_nr);
|
||||
@autoreleasepool {
|
||||
MRMediaRemoteGetNowPlayingInfo(dispatch_get_main_queue(), ^(NSDictionary* dict) {
|
||||
@autoreleasepool {
|
||||
|
@ -155,6 +158,8 @@ bool g_media_events = false;
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(name);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue