mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-08 17:50:10 +00:00
gtk: Don't drop too many references
We only have one reference to the surface, and it is dropped by gdk_surface_destroy. All the users of surfaces in gtk had the same bug: they were all stealing an extra reference to drop - the one that the renderer was leaking until recently.
This commit is contained in:
parent
aee214b09d
commit
1a9c03449e
@ -1017,8 +1017,7 @@ gtk_popover_unrealize (GtkWidget *widget)
|
||||
g_signal_handlers_disconnect_by_func (priv->surface, surface_render, widget);
|
||||
g_signal_handlers_disconnect_by_func (priv->surface, surface_event, widget);
|
||||
gdk_surface_set_widget (priv->surface, NULL);
|
||||
gdk_surface_destroy (priv->surface);
|
||||
g_clear_object (&priv->surface);
|
||||
g_clear_pointer (&priv->surface, gdk_surface_destroy);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -280,8 +280,7 @@ gtk_text_handle_unrealize (GtkWidget *widget)
|
||||
g_signal_handlers_disconnect_by_func (handle->surface, surface_mapped_changed, widget);
|
||||
|
||||
gdk_surface_set_widget (handle->surface, NULL);
|
||||
gdk_surface_destroy (handle->surface);
|
||||
g_clear_object (&handle->surface);
|
||||
g_clear_pointer (&handle->surface, gdk_surface_destroy);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -240,8 +240,7 @@ gtk_tooltip_window_unrealize (GtkWidget *widget)
|
||||
g_signal_handlers_disconnect_by_func (window->surface, surface_render, widget);
|
||||
g_signal_handlers_disconnect_by_func (window->surface, surface_event, widget);
|
||||
gdk_surface_set_widget (window->surface, NULL);
|
||||
gdk_surface_destroy (window->surface);
|
||||
g_clear_object (&window->surface);
|
||||
g_clear_pointer (&window->surface, gdk_surface_destroy);
|
||||
}
|
||||
|
||||
|
||||
|
@ -4451,8 +4451,7 @@ gtk_window_unrealize (GtkWidget *widget)
|
||||
GTK_WIDGET_CLASS (gtk_window_parent_class)->unrealize (widget);
|
||||
|
||||
gdk_surface_set_widget (surface, NULL);
|
||||
gdk_surface_destroy (surface);
|
||||
g_clear_object (&priv->surface);
|
||||
g_clear_pointer (&priv->surface, gdk_surface_destroy);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user