Skip to content

Commit f199351

Browse files
committed
Fix a stack overflow in the C callback userNotificationCenter from hs.notify
1 parent 6d2dae7 commit f199351

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

extensions/notify/internal.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,11 @@ - (void)userNotificationCenter:(NSUserNotificationCenter *)center
158158
// NSLog(@"invoking callback handler") ;
159159

160160
if ([skin protectedCallAndError:@"hs.notify callback" nargs:2 nresults:0] == NO) {
161+
lua_pop(skin.L, 1); // pop the hs.notify module
161162
_lua_stackguard_exit(skin.L);
162163
return;
163164
}
164-
165-
// FIXME: Things have been pushed onto the Lua stack, we probably need some lua_pop()s here
165+
lua_pop(skin.L, 1); // pop the hs.notify module
166166

167167
BOOL shouldWithdraw = [[notification.userInfo valueForKey:@"autoWithdraw"] boolValue] ;
168168
if (notification.deliveryRepeatInterval != nil) shouldWithdraw = YES ;

0 commit comments

Comments
 (0)