Kaydet (Commit) 456fb845 authored tarafından Matthew J. Francis's avatar Matthew J. Francis Kaydeden (comit) Caolán McNamara

Fix miscellaneous memory leaks

thumbnailview.cxx: ::ImplInitSettings is called from various
places other than the constructor, so mpItemAttrs must be
freed each time
gloactiongroup.cxx: Must call g_list_free on list returned by
g_hash_table_get_keys

Change-Id: Id5a592520987a1596debdbc48bfa171a537e400b
Reviewed-on: https://gerrit.libreoffice.org/11638Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst d7fdf70c
...@@ -59,6 +59,7 @@ enum ...@@ -59,6 +59,7 @@ enum
ThumbnailView::ThumbnailView (vcl::Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren) ThumbnailView::ThumbnailView (vcl::Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
: Control( pParent, nWinStyle ) : Control( pParent, nWinStyle )
{ {
mpItemAttrs = NULL;
ImplInit(); ImplInit();
mbIsTransientChildrenDisabled = bDisableTransientChildren; mbIsTransientChildrenDisabled = bDisableTransientChildren;
} }
...@@ -215,7 +216,7 @@ void ThumbnailView::ImplInitSettings( bool bFont, bool bForeground, bool bBackgr ...@@ -215,7 +216,7 @@ void ThumbnailView::ImplInitSettings( bool bFont, bool bForeground, bool bBackgr
SetBackground( aColor ); SetBackground( aColor );
} }
delete mpItemAttrs;
mpItemAttrs = new ThumbnailItemAttributes; mpItemAttrs = new ThumbnailItemAttributes;
mpItemAttrs->aFillColor = maColor.getBColor(); mpItemAttrs->aFillColor = maColor.getBColor();
mpItemAttrs->aHighlightColor = rStyleSettings.GetHighlightColor().getBColor(); mpItemAttrs->aHighlightColor = rStyleSettings.GetHighlightColor().getBColor();
......
...@@ -430,6 +430,8 @@ g_lo_action_group_clear (GLOActionGroup *group) ...@@ -430,6 +430,8 @@ g_lo_action_group_clear (GLOActionGroup *group)
{ {
g_lo_action_group_remove (group, (gchar*) element->data); g_lo_action_group_remove (group, (gchar*) element->data);
} }
g_list_free (keys);
} }
#endif #endif
......
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