mouse: fix memory leak on resize

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-08-06 16:22:48 +02:00
parent db9e50e728
commit e9adbff429
1 changed files with 8 additions and 5 deletions

13
mouse.c
View File

@ -925,7 +925,7 @@ mouse_client_resize(client_t *c, corner_t corner, bool infobox)
if(layout == layout_floating || c->isfloating) if(layout == layout_floating || c->isfloating)
{ {
if(c->isfixed) if(c->isfixed)
return; goto bailout;
c->ismax = false; c->ismax = false;
@ -940,18 +940,21 @@ mouse_client_resize(client_t *c, corner_t corner, bool infobox)
n++; n++;
/* only masters on this screen? */ /* only masters on this screen? */
if(n <= curtags[0]->nmaster) return; if(n <= curtags[0]->nmaster)
goto bailout;
/* no tiled clients on this screen? */ /* no tiled clients on this screen? */
for(c = globalconf.clients; c && !IS_TILED(c, screen); c = c->next); for(c = globalconf.clients; c && !IS_TILED(c, screen); c = c->next);
if(!c) return; if(!c)
goto bailout;
mouse_client_resize_tiled(c); mouse_client_resize_tiled(c);
} }
else if(layout == layout_magnifier) else if(layout == layout_magnifier)
{
mouse_client_resize_magnified(c, infobox); mouse_client_resize_magnified(c, infobox);
}
bailout:
p_delete(&curtags);
} }
/** Resize a client with mouse. /** Resize a client with mouse.