mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 12:41:07 +00:00
Fix memleak in get_nsscreen_for_point()
One codepath did not go through GDK_QUARTZ_RELEASE_POOL, refactored the code to fix this.
This commit is contained in:
parent
81cf73ae8a
commit
969ff4c863
@ -890,6 +890,7 @@ get_nsscreen_for_point (gint x, gint y)
|
||||
{
|
||||
int i;
|
||||
NSArray *screens;
|
||||
NSScreen *screen = NULL;
|
||||
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
|
||||
@ -901,12 +902,15 @@ get_nsscreen_for_point (gint x, gint y)
|
||||
|
||||
if (x >= rect.origin.x && x <= rect.origin.x + rect.size.width &&
|
||||
y >= rect.origin.y && y <= rect.origin.y + rect.size.height)
|
||||
return [screens objectAtIndex:i];
|
||||
{
|
||||
screen = [screens objectAtIndex:i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
|
||||
return NULL;
|
||||
return screen;
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user