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:
Kristian Rietveld 2009-12-30 14:12:42 +01:00
parent 3887838244
commit 255c2739e2

View File

@ -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