mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-14 19:55:12 +01:00
g_osx_appinfo_launch: Use autorelease pool to manage cocoa memory.
Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/3568
This commit is contained in:
parent
bfeca8c13a
commit
d3705ecdcf
@ -291,7 +291,6 @@ clear_urlspec (LSLaunchURLSpec *urlspec)
|
||||
CFArrayRemoveAllValues ((CFMutableArrayRef) urlspec->itemURLs);
|
||||
CFRelease (urlspec->itemURLs);
|
||||
}
|
||||
CFRelease (urlspec->appURL);
|
||||
}
|
||||
|
||||
static NSBundle *
|
||||
@ -450,6 +449,7 @@ g_osx_app_info_launch_internal (GAppInfo *appinfo,
|
||||
GOsxAppInfo *info = G_OSX_APP_INFO (appinfo);
|
||||
LSLaunchURLSpec urlspec = { 0 };
|
||||
gint ret, success = TRUE;
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
g_return_val_if_fail (G_IS_OSX_APP_INFO (appinfo), FALSE);
|
||||
|
||||
@ -464,6 +464,7 @@ g_osx_app_info_launch_internal (GAppInfo *appinfo,
|
||||
}
|
||||
|
||||
clear_urlspec (&urlspec);
|
||||
[pool drain];
|
||||
return success;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user