From 4ed4bb330e1814fcc5a403c094ffb755addb938f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 3 Oct 2014 16:49:21 +0200 Subject: [PATCH] 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 file changed, 4 insertions(+) diff --git a/js/ui/screencast.js b/js/ui/screencast.js index d1ccc5be7..def5dc9fa 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));