[rygel] core: If request is cancelled, don't end it twice



commit 8689960f83ca7188b6fc47e39f0dbeb71515a844
Author: Jens Georg <mail jensge org>
Date:   Thu Jul 7 17:41:06 2011 +0200

    core: If request is cancelled, don't end it twice
    
    This was causing these rare crashes:
    
    rygel_http_response_real_run_co: code should not be reached

 src/rygel/rygel-http-response.vala |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-http-response.vala b/src/rygel/rygel-http-response.vala
index 359df5f..4f8dfa9 100644
--- a/src/rygel/rygel-http-response.vala
+++ b/src/rygel/rygel-http-response.vala
@@ -242,9 +242,13 @@ internal class Rygel.HTTPResponse : GLib.Object, Rygel.StateMachine {
             }
         }
 
+        // If pipeline state didn't change due to the request being cancelled,
+        // end this request. Otherwise it was already ended.
         if (!ret) {
             Idle.add_full (this.priority, () => {
-                this.end (false, KnownStatusCode.NONE);
+                if (!this.cancellable.is_cancelled ()) {
+                    this.end (false, KnownStatusCode.NONE);
+                }
 
                 return false;
             });



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