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

skins2: fix memory leak regarding previous commit

parent d7615a6e
...@@ -211,16 +211,16 @@ void X11Factory::getMonitorInfo( const GenericWindow &rWindow, ...@@ -211,16 +211,16 @@ void X11Factory::getMonitorInfo( const GenericWindow &rWindow,
XineramaScreenInfo* info = XineramaQueryScreens( pDisplay, &num ); XineramaScreenInfo* info = XineramaQueryScreens( pDisplay, &num );
if( info ) if( info )
{ {
Region reg1 = XCreateRegion();
XRectangle rect1 = { x, y, w, h };
XUnionRectWithRegion( &rect1, reg1, reg1 );
unsigned int surface = 0; unsigned int surface = 0;
for( int i = 0; i < num; i++ ) for( int i = 0; i < num; i++ )
{ {
Region reg1 = XCreateRegion();
XRectangle rect1 = { info[i].x_org, info[i].y_org,
info[i].width, info[i].height };
XUnionRectWithRegion( &rect1, reg1, reg1 );
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