[glib] gsignal: add assert on closure invalidate path



commit c64b6da33c4d2401dc01329dcac7b32e2274fbfd
Author: Ryan Lortie <desrt desrt ca>
Date:   Fri Jun 6 12:15:22 2014 -0400

    gsignal: add assert on closure invalidate path
    
    It's theoretically possible that we could have a case where this would
    actually return NULL, but it's difficult to imagine a valid program that
    would contain such a case.
    
    Add an explicit assert here to quiet up static analysis.
    
    See the bug for more discussion.
    
    Coverity CID: 1159477
    
    https://bugzilla.gnome.org/show_bug.cgi?id=730296

 gobject/gsignal.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gobject/gsignal.c b/gobject/gsignal.c
index 38f528e..b22dfcc 100644
--- a/gobject/gsignal.c
+++ b/gobject/gsignal.c
@@ -3804,6 +3804,8 @@ invalid_closure_notify (gpointer  instance,
   SIGNAL_LOCK ();
 
   handler = handler_lookup (instance, 0, closure, &signal_id);
+  /* See https://bugzilla.gnome.org/show_bug.cgi?id=730296 for discussion about this... */
+  g_assert (handler != NULL);
   g_assert (handler->closure == closure);
 
   handler->sequential_number = 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]