mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-20 02:10:12 +00:00
Disconnect signal handlers on adjustment in destroy handler
Not removing the signal handler caused crashes if the adjustment survived longer than the scrolled window and still emitted signals. This could happen inside WebKit.
This commit is contained in:
parent
7545e7211c
commit
71d7b97a90
@ -858,6 +858,9 @@ gtk_scrolled_window_destroy (GtkObject *object)
|
|||||||
|
|
||||||
if (scrolled_window->hscrollbar)
|
if (scrolled_window->hscrollbar)
|
||||||
{
|
{
|
||||||
|
g_signal_handlers_disconnect_by_func (gtk_range_get_adjustment (GTK_RANGE (scrolled_window->hscrollbar)),
|
||||||
|
gtk_scrolled_window_adjustment_changed,
|
||||||
|
scrolled_window);
|
||||||
gtk_widget_unparent (scrolled_window->hscrollbar);
|
gtk_widget_unparent (scrolled_window->hscrollbar);
|
||||||
gtk_widget_destroy (scrolled_window->hscrollbar);
|
gtk_widget_destroy (scrolled_window->hscrollbar);
|
||||||
g_object_unref (scrolled_window->hscrollbar);
|
g_object_unref (scrolled_window->hscrollbar);
|
||||||
@ -865,6 +868,9 @@ gtk_scrolled_window_destroy (GtkObject *object)
|
|||||||
}
|
}
|
||||||
if (scrolled_window->vscrollbar)
|
if (scrolled_window->vscrollbar)
|
||||||
{
|
{
|
||||||
|
g_signal_handlers_disconnect_by_func (gtk_range_get_adjustment (GTK_RANGE (scrolled_window->vscrollbar)),
|
||||||
|
gtk_scrolled_window_adjustment_changed,
|
||||||
|
scrolled_window);
|
||||||
gtk_widget_unparent (scrolled_window->vscrollbar);
|
gtk_widget_unparent (scrolled_window->vscrollbar);
|
||||||
gtk_widget_destroy (scrolled_window->vscrollbar);
|
gtk_widget_destroy (scrolled_window->vscrollbar);
|
||||||
g_object_unref (scrolled_window->vscrollbar);
|
g_object_unref (scrolled_window->vscrollbar);
|
||||||
|
Loading…
Reference in New Issue
Block a user