From ffc56ca2851f651a994a7aec74eb8d4b1bb674e9 Mon Sep 17 00:00:00 2001 From: koekeishiya Date: Sun, 3 May 2020 00:34:04 +0200 Subject: [PATCH] .. --- src/notify.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/notify.c b/src/notify.c index 9ef0413a..04c416e2 100644 --- a/src/notify.c +++ b/src/notify.c @@ -10,10 +10,10 @@ void notify(const char *subtitle, const char *format, ...) { va_list args; va_start(args, format); + CFStringRef format_ref = CFStringCreateWithCString(NULL, format, kCFStringEncodingUTF8); CFStringRef subtitle_ref = CFStringCreateWithCString(NULL, subtitle, kCFStringEncodingUTF8); CFStringRef message_ref = CFStringCreateWithFormatAndArguments(NULL, NULL, format_ref, args); - va_end(args); void *center = objc_msgSend((void *) objc_getClass("NSUserNotificationCenter"), sel_registerName("defaultUserNotificationCenter")); void *notification = objc_msgSend((void *) objc_getClass("NSUserNotification"), sel_registerName("alloc"), sel_registerName("init")); @@ -26,4 +26,6 @@ void notify(const char *subtitle, const char *format, ...) CFRelease(message_ref); CFRelease(subtitle_ref); CFRelease(format_ref); + + va_end(args); }