[evolution/gnome-3-24] AlertBar from ShellContent not freed
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-24] AlertBar from ShellContent not freed
- Date: Tue, 11 Jul 2017 17:17:31 +0000 (UTC)
commit 6634171c3d4ca144a4510a5aba7c3e27370473bb
Author: Milan Crha <mcrha redhat com>
Date: Tue Jul 11 19:15:05 2017 +0200
AlertBar from ShellContent not freed
That was a memory leak, but apart of that it could also cause use-after-free
crash in gtk_widget_get_scale_factor() under _gtk_style_cascade_add_provider()
called from shell_window_constructed(), when creating a new shell window
for the second time, with the previous one already closed.
src/shell/e-shell-content.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/shell/e-shell-content.c b/src/shell/e-shell-content.c
index 88a7fe7..662b458 100644
--- a/src/shell/e-shell-content.c
+++ b/src/shell/e-shell-content.c
@@ -150,7 +150,10 @@ shell_content_dispose (GObject *object)
priv->shell_view = NULL;
}
- g_clear_object (&priv->alert_bar);
+ if (priv->alert_bar) {
+ gtk_widget_unparent (priv->alert_bar);
+ g_clear_object (&priv->alert_bar);
+ }
/* Chain up to parent's dispose() method. */
G_OBJECT_CLASS (e_shell_content_parent_class)->dispose (object);
@@ -351,7 +354,7 @@ shell_content_remove (GtkContainer *container,
if (widget == priv->alert_bar) {
gtk_widget_unparent (priv->alert_bar);
- priv->alert_bar = NULL;
+ g_clear_object (&priv->alert_bar);
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]