make sure we only shut down the stream if we actually have an active stream
authorRobert Kaiser <kairo@kairo.at>
Sun, 14 Sep 2014 20:48:13 +0000 (22:48 +0200)
committerRobert Kaiser <kairo@kairo.at>
Sun, 14 Sep 2014 20:48:13 +0000 (22:48 +0200)
js/tricorder.js

index 317fbca..50b0625 100644 (file)
@@ -281,8 +281,10 @@ var gModSound = {
       window.requestAnimationFrame(gModSound.paintAnalyzerFrame);
   },
   deactivate: function() {
-    gModSound.mDisplay.active = false;
-    gModSound.mAudio.stream.stop();
+    if (gModSound.mDisplay.active) {
+      gModSound.mAudio.stream.stop();
+      gModSound.mDisplay.active = false;
+    }
     gSounds.scan.pause();
   },
 }