Merge branch 'incorrect-reference-count-decrement' of https://github.com/Luflosi/kitty

This commit is contained in:
Kovid Goyal 2020-11-04 07:44:00 +05:30
commit ef6164eecb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -182,14 +182,9 @@ cocoa_send_notification(PyObject *self UNUSED, PyObject *args) {
if (!center) {PyErr_SetString(PyExc_RuntimeError, "Failed to get the user notification center"); return NULL; } if (!center) {PyErr_SetString(PyExc_RuntimeError, "Failed to get the user notification center"); return NULL; }
if (!center.delegate) center.delegate = [[NotificationDelegate alloc] init]; if (!center.delegate) center.delegate = [[NotificationDelegate alloc] init];
NSUserNotification *n = [NSUserNotification new]; NSUserNotification *n = [NSUserNotification new];
#define SET(x) { \ if (title) n.title = @(title);
if (x) { \ if (subtitle) n.subtitle = @(subtitle);
NSString *t = @(x); \ if (informativeText) n.informativeText = @(informativeText);
n.x = t; \
[t release]; \
}}
SET(title); SET(subtitle); SET(informativeText);
#undef SET
if (identifier) { if (identifier) {
n.userInfo = @{@"user_id": @(identifier)}; n.userInfo = @{@"user_id": @(identifier)};
} }