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.
This commit is contained in:
Dan Winship 2010-04-25 22:54:12 -04:00
parent 644dfbd704
commit 622916b731

View File

@ -579,6 +579,9 @@ g_cancellable_release_fd (GCancellable *cancellable)
{ {
GCancellablePrivate *priv; GCancellablePrivate *priv;
if (cancellable == NULL)
return;
g_return_if_fail (G_IS_CANCELLABLE (cancellable)); g_return_if_fail (G_IS_CANCELLABLE (cancellable));
g_return_if_fail (cancellable->priv->fd_refcount > 0); g_return_if_fail (cancellable->priv->fd_refcount > 0);