diff --git a/extensions/application/internal.m b/extensions/application/internal.m index 99f572d5c..4682c87ff 100644 --- a/extensions/application/internal.m +++ b/extensions/application/internal.m @@ -623,7 +623,7 @@ AXUIElementRef _findmenuitembyname(lua_State* L, AXUIElementRef app, NSString *n [skin logBreadcrumb:[NSString stringWithFormat:@"Got an error (%d) fetching menu children, skipping", (int)error]]; continue; } - [toCheck addObjectsFromArray:(__bridge NSArray *)cf_menuchildren]; + [toCheck addObjectsFromArray:(__bridge_transfer NSArray *)cf_menuchildren]; } else if (childcount == 0) { // This doesn't seem to be a submenu, so see if it's a match if (!nameIsRegex && [name isEqualToString:title]) { @@ -745,6 +745,7 @@ AXUIElementRef _findmenuitembypath(lua_State* L __unused, AXUIElementRef app, NS break; } } + CFRelease(cf_children); if (!found) { [skin logBreadcrumb:@"Unable to resolve complete search path"]; diff --git a/extensions/window/internal.m b/extensions/window/internal.m index fdb3af6d5..55dd7dbbd 100644 --- a/extensions/window/internal.m +++ b/extensions/window/internal.m @@ -160,6 +160,7 @@ static BOOL window_presstab(AXUIElementRef win, CFIndex tabIndex) { worked = YES; cleanup: if (tabs) CFRelease(tabs); + if (children) CFRelease(children); return worked; }