[gnome-shell] screencast: Don't leak recorders on failure



commit 4ed4bb330e1814fcc5a403c094ffb755addb938f
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Oct 3 16:49:21 2014 +0200

    screencast: Don't leak recorders on failure
    
    ShellRecorder.record() may fail, remove the recorder from the map
    in that case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=737846

 js/ui/screencast.js |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/screencast.js b/js/ui/screencast.js
index d1ccc5b..def5dc9 100644
--- a/js/ui/screencast.js
+++ b/js/ui/screencast.js
@@ -117,6 +117,8 @@ const ScreencastService = new Lang.Class({
             this._applyOptionalParameters(recorder, options);
             let [success, fileName] = recorder.record();
             returnValue = [success, fileName ? fileName : ''];
+            if (!success)
+                this._stopRecordingForSender(sender);
         }
 
         invocation.return_value(GLib.Variant.new('(bs)', returnValue));
@@ -150,6 +152,8 @@ const ScreencastService = new Lang.Class({
             this._applyOptionalParameters(recorder, options);
             let [success, fileName] = recorder.record();
             returnValue = [success, fileName ? fileName : ''];
+            if (!success)
+                this._stopRecordingForSender(sender);
         }
 
         invocation.return_value(GLib.Variant.new('(bs)', returnValue));


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