From 43b44fff94938c0711512a23ef5e0f21f38a470b Mon Sep 17 00:00:00 2001 From: Soeren Sandmann Date: Sat, 17 Jan 2004 11:51:28 +0000 Subject: [PATCH] Don't leak the overflow menu. Sat Jan 17 12:37:46 2004 Soeren Sandmann * gtk/gtktoolbar.c (gtk_toolbar_finalize): Don't leak the overflow menu. * gtk/gtktoolbar.h (struct _GtkToolbar): Make some fields public. [#127726] --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-4 | 8 ++++++++ ChangeLog.pre-2-6 | 8 ++++++++ ChangeLog.pre-2-8 | 8 ++++++++ gtk/gtktoolbar.c | 5 ++++- gtk/gtktoolbar.h | 16 +++++++++++----- 7 files changed, 55 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e60c896020..19bc869dde 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sat Jan 17 12:37:46 2004 Soeren Sandmann + + * gtk/gtktoolbar.c (gtk_toolbar_finalize): Don't leak the + overflow menu. + + * gtk/gtktoolbar.h (struct _GtkToolbar): Make some fields public. + [#127726] + 2004-01-16 Federico Mena Quintero * gtk/gtkfilesystemmodel.c (struct _GtkFileSystemModel): Added a diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e60c896020..19bc869dde 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Sat Jan 17 12:37:46 2004 Soeren Sandmann + + * gtk/gtktoolbar.c (gtk_toolbar_finalize): Don't leak the + overflow menu. + + * gtk/gtktoolbar.h (struct _GtkToolbar): Make some fields public. + [#127726] + 2004-01-16 Federico Mena Quintero * gtk/gtkfilesystemmodel.c (struct _GtkFileSystemModel): Added a diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index e60c896020..19bc869dde 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Sat Jan 17 12:37:46 2004 Soeren Sandmann + + * gtk/gtktoolbar.c (gtk_toolbar_finalize): Don't leak the + overflow menu. + + * gtk/gtktoolbar.h (struct _GtkToolbar): Make some fields public. + [#127726] + 2004-01-16 Federico Mena Quintero * gtk/gtkfilesystemmodel.c (struct _GtkFileSystemModel): Added a diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index e60c896020..19bc869dde 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Sat Jan 17 12:37:46 2004 Soeren Sandmann + + * gtk/gtktoolbar.c (gtk_toolbar_finalize): Don't leak the + overflow menu. + + * gtk/gtktoolbar.h (struct _GtkToolbar): Make some fields public. + [#127726] + 2004-01-16 Federico Mena Quintero * gtk/gtkfilesystemmodel.c (struct _GtkFileSystemModel): Added a diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e60c896020..19bc869dde 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Sat Jan 17 12:37:46 2004 Soeren Sandmann + + * gtk/gtktoolbar.c (gtk_toolbar_finalize): Don't leak the + overflow menu. + + * gtk/gtktoolbar.h (struct _GtkToolbar): Make some fields public. + [#127726] + 2004-01-16 Federico Mena Quintero * gtk/gtkfilesystemmodel.c (struct _GtkFileSystemModel): Added a diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c index eabd4d9b58..7cfeb6ec24 100644 --- a/gtk/gtktoolbar.c +++ b/gtk/gtktoolbar.c @@ -3602,7 +3602,7 @@ gtk_toolbar_finalize (GObject *object) GList *list; GtkToolbar *toolbar = GTK_TOOLBAR (object); GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); - + if (toolbar->tooltips) g_object_unref (toolbar->tooltips); @@ -3618,6 +3618,9 @@ gtk_toolbar_finalize (GObject *object) g_timer_destroy (priv->timer); + if (priv->menu) + gtk_widget_destroy (priv->menu); + if (priv->idle_id) g_source_remove (priv->idle_id); diff --git a/gtk/gtktoolbar.h b/gtk/gtktoolbar.h index 195b38657f..a7fa7bdc76 100644 --- a/gtk/gtktoolbar.h +++ b/gtk/gtktoolbar.h @@ -76,14 +76,14 @@ struct _GtkToolbarChild GtkWidget *label; }; +#endif /* GTK_DISABLE_DEPRECATED */ + typedef enum { GTK_TOOLBAR_SPACE_EMPTY, GTK_TOOLBAR_SPACE_LINE } GtkToolbarSpaceStyle; -#endif /* GTK_DISABLE_DEPRECATED */ - typedef struct _GtkToolbar GtkToolbar; typedef struct _GtkToolbarClass GtkToolbarClass; typedef struct _GtkToolbarPrivate GtkToolbarPrivate; @@ -92,7 +92,7 @@ struct _GtkToolbar { GtkContainer container; - /*< private >*/ + /*< public >*/ gint num_children; GList *children; GtkOrientation orientation; @@ -101,6 +101,7 @@ struct _GtkToolbar GtkTooltips *tooltips; + /*< private >*/ gint button_maxw; /* maximum width of homogeneous children */ gint button_maxh; /* maximum height of homogeneous children */ @@ -164,8 +165,13 @@ void gtk_toolbar_set_drop_highlight_item (GtkToolbar *toolbar, gint index); -/* internal function */ -gchar * _gtk_toolbar_elide_underscores (const gchar *original); +/* internal functions */ +gchar * _gtk_toolbar_elide_underscores (const gchar *original); +/* these two functions actually accept NULL for the toolbar, in which case + * you'll get a default value + */ +int _gtk_toolbar_get_space_size (GtkToolbar *toolbar); +GtkToolbarSpaceStyle _gtk_toolbar_get_space_style (GtkToolbar *toolbar); #ifndef GTK_DISABLE_DEPRECATED void gtk_toolbar_set_icon_size (GtkToolbar *toolbar,