summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2018-02-06 11:49:23 +0100
committerTimm Bäder <mail@baedert.org>2018-02-06 13:40:57 +0100
commit4f50c68296fdc321f42e4c19661969627ba51c85 (patch)
tree6a6271715d7112897f801c277da3d4337572de6f
parentfab944941487e4a9f04d51814412b4c2bf153bfe (diff)
downloadgtk+-4f50c68296fdc321f42e4c19661969627ba51c85.tar.gz
cellrendereraccel: unref sizing_label
-rw-r--r--gtk/gtkcellrendereraccel.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c
index 5c6784588d..ab9e1c4d86 100644
--- a/gtk/gtkcellrendereraccel.c
+++ b/gtk/gtkcellrendereraccel.c
@@ -113,6 +113,16 @@ gtk_cell_renderer_accel_init (GtkCellRendererAccel *cell_accel)
}
static void
+gtk_cell_renderer_accel_dispose (GObject *object)
+{
+ GtkCellRendererAccelPrivate *priv = GTK_CELL_RENDERER_ACCEL (object)->priv;
+
+ g_clear_object (&priv->sizing_label);
+
+ G_OBJECT_CLASS (gtk_cell_renderer_accel_parent_class)->dispose (object);
+}
+
+static void
gtk_cell_renderer_accel_class_init (GtkCellRendererAccelClass *cell_accel_class)
{
GObjectClass *object_class;
@@ -123,6 +133,7 @@ gtk_cell_renderer_accel_class_init (GtkCellRendererAccelClass *cell_accel_class)
object_class->set_property = gtk_cell_renderer_accel_set_property;
object_class->get_property = gtk_cell_renderer_accel_get_property;
+ object_class->dispose = gtk_cell_renderer_accel_dispose;
cell_renderer_class->get_preferred_width = gtk_cell_renderer_accel_get_preferred_width;
cell_renderer_class->start_editing = gtk_cell_renderer_accel_start_editing;
@@ -396,7 +407,10 @@ gtk_cell_renderer_accel_get_preferred_width (GtkCellRenderer *cell,
GtkRequisition min_req, nat_req;
if (priv->sizing_label == NULL)
- priv->sizing_label = gtk_label_new (_("New accelerator…"));
+ {
+ priv->sizing_label = gtk_label_new (_("New accelerator…"));
+ g_object_ref_sink (priv->sizing_label);
+ }
gtk_widget_get_preferred_size (priv->sizing_label, &min_req, &nat_req);