[xdg-desktop-portal-gnome] screencastwidget: Avoid reading destroyed widgets
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [xdg-desktop-portal-gnome] screencastwidget: Avoid reading destroyed widgets
- Date: Fri, 13 Aug 2021 20:11:16 +0000 (UTC)
commit 946e91b6dedc3b9b8d403187d316c0c91bcffd9a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Fri Aug 13 16:10:47 2021 -0300
screencastwidget: Avoid reading destroyed widgets
src/screencastwidget.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/screencastwidget.c b/src/screencastwidget.c
index 031cf94..a9265b1 100644
--- a/src/screencastwidget.c
+++ b/src/screencastwidget.c
@@ -160,11 +160,13 @@ update_windows_list (ScreenCastWidget *widget)
GList *windows;
GList *l;
- for (child = gtk_widget_get_first_child (GTK_WIDGET (window_list));
- child;
- child = gtk_widget_get_next_sibling (child))
+ child = gtk_widget_get_first_child (GTK_WIDGET (window_list));
+ while (child)
{
+ GtkWidget *next = gtk_widget_get_next_sibling (child);
+
gtk_list_box_remove (window_list, child);
+ child = next;
}
toplevel = gtk_widget_get_ancestor (GTK_WIDGET (widget), GTK_TYPE_WINDOW);
@@ -193,11 +195,13 @@ update_monitors_list (ScreenCastWidget *widget)
GList *logical_monitors;
GList *l;
- for (child = gtk_widget_get_first_child (GTK_WIDGET (monitor_list));
- child;
- child = gtk_widget_get_next_sibling (child))
+ child = gtk_widget_get_first_child (GTK_WIDGET (monitor_list));
+ while (child)
{
+ GtkWidget *next = gtk_widget_get_next_sibling (child);
+
gtk_list_box_remove (monitor_list, child);
+ child = next;
}
logical_monitors =
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]