Skip to content

Commit

Permalink
Fix two memory leaks in hs.application and one in hs.window
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsj committed Jul 12, 2018
1 parent 24cca61 commit 6608ec6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extensions/application/internal.m
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down Expand Up @@ -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"];
Expand Down
1 change: 1 addition & 0 deletions extensions/window/internal.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6608ec6

Please sign in to comment.