[gnome-continuous] testbase: Fix source ID warning



commit 735b0e38cc3f48c3e35ab6a724db07359e5cbd91
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Jun 1 08:30:56 2015 -0700

    testbase: Fix source ID warning
    
    This has been bugging me for a bit. Basically, the timeout already
    returns a false-y value, so the source_remove has always been
    invalid. Add an explicit return to timeout, and remove the explicit
    source_remove.

 src/js/tasks/testbase.js |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/js/tasks/testbase.js b/src/js/tasks/testbase.js
index 2798a8d..cae5454 100644
--- a/src/js/tasks/testbase.js
+++ b/src/js/tasks/testbase.js
@@ -105,6 +105,7 @@ const TestOneDisk = new Lang.Class({
         }
         this._fail("Timed out");
         this._loop.quit();
+        return GLib.SOURCE_REMOVE;
     },
 
     _onJournalOpen: function(file, result) {
@@ -503,8 +504,8 @@ const TestOneDisk = new Lang.Class({
 
         let commandConnectAttemptTimeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 1,
                                                                       Lang.bind(this, 
this._tryCommandConnection));
-        let timeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, this._timeout,
-                                                 Lang.bind(this, this._onTimeout));
+        GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, this._timeout,
+                                 Lang.bind(this, this._onTimeout));
 
         // Let's only do a screenshot every 3 seconds, I think it's slowing things down...
         let screenshotTimeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 3,
@@ -520,8 +521,6 @@ const TestOneDisk = new Lang.Class({
 
         if (this._journalTextStream)
             this._journalTextStream.close(null);
-
-        GLib.source_remove(timeoutId);
         
         let [gfmnt, mntdir] = LibQA.newReadWriteMount(diskClone, cancellable);
         try {


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