[libadwaita] carousel: Better check the child is correct in remove()
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita] carousel: Better check the child is correct in remove()
- Date: Fri, 21 May 2021 07:54:40 +0000 (UTC)
commit 8e7ef84a9ff14a26ca0a3d2c437c80840c12bd34
Author: Adrien Plazas <kekun plazas laposte net>
Date: Fri May 21 08:03:21 2021 +0200
carousel: Better check the child is correct in remove()
Now that there isn't AdwCarouselBox anymore, we can directly check if
the child belongs to the carousel.
src/adw-carousel.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/adw-carousel.c b/src/adw-carousel.c
index 1013abd8..9d5cb76b 100644
--- a/src/adw-carousel.c
+++ b/src/adw-carousel.c
@@ -1320,11 +1320,11 @@ adw_carousel_remove (AdwCarousel *self,
g_return_if_fail (ADW_IS_CAROUSEL (self));
g_return_if_fail (GTK_IS_WIDGET (child));
+ g_return_if_fail (gtk_widget_get_parent (child) == GTK_WIDGET (self));
info = find_child_info (self, child);
- if (!info)
- return;
+ g_assert_nonnull (info);
info->removing = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]