mirror of
https://github.com/brl/mutter.git
synced 2025-01-23 01:48:55 +00:00
constraints: fix mem leak in meta_window_constrain()
MetaFrameBorders leaked when orig_borders != NULL and window->fullscreen == TRUE https://bugzilla.gnome.org/show_bug.cgi?id=679153
This commit is contained in:
parent
e4ae7d7b1b
commit
255347f876
@ -119,6 +119,7 @@ typedef struct
|
|||||||
MetaRectangle orig;
|
MetaRectangle orig;
|
||||||
MetaRectangle current;
|
MetaRectangle current;
|
||||||
MetaFrameBorders *borders;
|
MetaFrameBorders *borders;
|
||||||
|
gboolean must_free_borders;
|
||||||
ActionType action_type;
|
ActionType action_type;
|
||||||
gboolean is_user_action;
|
gboolean is_user_action;
|
||||||
|
|
||||||
@ -337,7 +338,7 @@ meta_window_constrain (MetaWindow *window,
|
|||||||
* not gobject-style--gobject would be more pain than it's worth) or
|
* not gobject-style--gobject would be more pain than it's worth) or
|
||||||
* smart pointers would be so much nicer here. *shrug*
|
* smart pointers would be so much nicer here. *shrug*
|
||||||
*/
|
*/
|
||||||
if (!orig_borders)
|
if (info.must_free_borders)
|
||||||
g_free (info.borders);
|
g_free (info.borders);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,9 +359,15 @@ setup_constraint_info (ConstraintInfo *info,
|
|||||||
|
|
||||||
/* Create a fake frame geometry if none really exists */
|
/* Create a fake frame geometry if none really exists */
|
||||||
if (orig_borders && !window->fullscreen)
|
if (orig_borders && !window->fullscreen)
|
||||||
info->borders = orig_borders;
|
{
|
||||||
|
info->borders = orig_borders;
|
||||||
|
info->must_free_borders = FALSE;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
info->borders = g_new0 (MetaFrameBorders, 1);
|
{
|
||||||
|
info->borders = g_new0 (MetaFrameBorders, 1);
|
||||||
|
info->must_free_borders = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (flags & META_IS_MOVE_ACTION && flags & META_IS_RESIZE_ACTION)
|
if (flags & META_IS_MOVE_ACTION && flags & META_IS_RESIZE_ACTION)
|
||||||
info->action_type = ACTION_MOVE_AND_RESIZE;
|
info->action_type = ACTION_MOVE_AND_RESIZE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user