Merge branch 'incorrect-reference-count-decrement' of https://github.com/Luflosi/kitty
This commit is contained in:
commit
ef6164eecb
@ -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)};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user