Merge branch 'scrolled-window-critical' into 'main'

scrolledwindow: Avoid a critical

See merge request GNOME/gtk!5809
This commit is contained in:
Matthias Clasen 2023-04-10 05:50:20 +00:00
commit 5e6bc681a3
2 changed files with 5 additions and 3 deletions

View File

@ -4202,9 +4202,7 @@ gtk_scrolled_window_set_child (GtkScrolledWindow *scrolled_window,
if (priv->child)
{
if (priv->auto_added_viewport)
{
gtk_viewport_set_child (GTK_VIEWPORT (priv->child), NULL);
}
gtk_viewport_set_child (GTK_VIEWPORT (priv->child), NULL);
g_object_set (priv->child,
"hadjustment", NULL,
@ -4212,6 +4210,7 @@ gtk_scrolled_window_set_child (GtkScrolledWindow *scrolled_window,
NULL);
g_clear_pointer (&priv->child, gtk_widget_unparent);
priv->auto_added_viewport = FALSE;
}
if (child)

View File

@ -383,6 +383,9 @@ check_property (GObject *instance, GParamSpec *pspec)
g_object_set (instance, pspec->name, NULL, NULL);
assert_notifies (instance, pspec->name, data.count, 2);
g_object_set (instance, pspec->name, value, NULL);
assert_notifies (instance, pspec->name, data.count, 3);
g_object_unref (value);
g_signal_handler_disconnect (instance, id);