[glib] g_cancellable_release_fd: allow NULL cancellable



commit 622916b731354c2dcd4178abf3ada08ca51dd38c
Author: Dan Winship <danw gnome org>
Date:   Sun Apr 25 22:54:12 2010 -0400

    g_cancellable_release_fd: allow NULL cancellable
    
    Almost all GCancellable methods silently do nothing if passed NULL for
    the cancellable. Make g_cancellable_release_fd() do that as well.

 gio/gcancellable.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gio/gcancellable.c b/gio/gcancellable.c
index 32d01ae..ea12b0a 100644
--- a/gio/gcancellable.c
+++ b/gio/gcancellable.c
@@ -579,6 +579,9 @@ g_cancellable_release_fd (GCancellable *cancellable)
 {
   GCancellablePrivate *priv;
 
+  if (cancellable == NULL)
+    return;
+
   g_return_if_fail (G_IS_CANCELLABLE (cancellable));
   g_return_if_fail (cancellable->priv->fd_refcount > 0);
 



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