Commit 5527a2ac authored by Benjamin Otte's avatar Benjamin Otte Committed by Allison Karlitskaya

Remove unneccessary variable from g_cancellable_cancel()

The variable makes a complicated function even more complicated.
parent c3f1025c
...@@ -613,7 +613,6 @@ g_cancellable_release_fd (GCancellable *cancellable) ...@@ -613,7 +613,6 @@ g_cancellable_release_fd (GCancellable *cancellable)
void void
g_cancellable_cancel (GCancellable *cancellable) g_cancellable_cancel (GCancellable *cancellable)
{ {
gboolean cancel;
GCancellablePrivate *priv; GCancellablePrivate *priv;
if (cancellable == NULL || if (cancellable == NULL ||
...@@ -621,10 +620,9 @@ g_cancellable_cancel (GCancellable *cancellable) ...@@ -621,10 +620,9 @@ g_cancellable_cancel (GCancellable *cancellable)
return; return;
priv = cancellable->priv; priv = cancellable->priv;
cancel = FALSE;
G_LOCK(cancellable); G_LOCK(cancellable);
cancel = TRUE;
priv->cancelled = TRUE; priv->cancelled = TRUE;
priv->cancelled_running = TRUE; priv->cancelled_running = TRUE;
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
...@@ -642,8 +640,6 @@ g_cancellable_cancel (GCancellable *cancellable) ...@@ -642,8 +640,6 @@ g_cancellable_cancel (GCancellable *cancellable)
} }
G_UNLOCK(cancellable); G_UNLOCK(cancellable);
if (cancel)
{
g_object_ref (cancellable); g_object_ref (cancellable);
g_signal_emit (cancellable, signals[CANCELLED], 0); g_signal_emit (cancellable, signals[CANCELLED], 0);
...@@ -657,7 +653,6 @@ g_cancellable_cancel (GCancellable *cancellable) ...@@ -657,7 +653,6 @@ g_cancellable_cancel (GCancellable *cancellable)
G_UNLOCK(cancellable); G_UNLOCK(cancellable);
g_object_unref (cancellable); g_object_unref (cancellable);
}
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment