Commit 73b7ccdf authored by Erwan Tulou's avatar Erwan Tulou

skins2: fix memory leak regarding previous commit

parent d7615a6e
...@@ -210,17 +210,17 @@ void X11Factory::getMonitorInfo( const GenericWindow &rWindow, ...@@ -210,17 +210,17 @@ void X11Factory::getMonitorInfo( const GenericWindow &rWindow,
int num; int num;
XineramaScreenInfo* info = XineramaQueryScreens( pDisplay, &num ); XineramaScreenInfo* info = XineramaQueryScreens( pDisplay, &num );
if( info ) if( info )
{
unsigned int surface = 0;
for( int i = 0; i < num; i++ )
{ {
Region reg1 = XCreateRegion(); Region reg1 = XCreateRegion();
XRectangle rect1 = { info[i].x_org, info[i].y_org, XRectangle rect1 = { x, y, w, h };
info[i].width, info[i].height };
XUnionRectWithRegion( &rect1, reg1, reg1 ); XUnionRectWithRegion( &rect1, reg1, reg1 );
unsigned int surface = 0;
for( int i = 0; i < num; i++ )
{
Region reg2 = XCreateRegion(); Region reg2 = XCreateRegion();
XRectangle rect2 = { x, y, w, h }; XRectangle rect2 = { info[i].x_org, info[i].y_org,
info[i].width, info[i].height };
XUnionRectWithRegion( &rect2, reg2, reg2 ); XUnionRectWithRegion( &rect2, reg2, reg2 );
Region reg = XCreateRegion(); Region reg = XCreateRegion();
...@@ -236,7 +236,10 @@ void X11Factory::getMonitorInfo( const GenericWindow &rWindow, ...@@ -236,7 +236,10 @@ void X11Factory::getMonitorInfo( const GenericWindow &rWindow,
*p_width = info[i].width; *p_width = info[i].width;
*p_height = info[i].height; *p_height = info[i].height;
} }
XDestroyRegion( reg );
XDestroyRegion( reg2 );
} }
XDestroyRegion( reg1 );
XFree( info ); XFree( info );
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment