[gnome-shell/wip/rstrode/rhel-8.0.0: 36/50] automountManager: remove allowAutorun expire timeout on volume removal
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/rstrode/rhel-8.0.0: 36/50] automountManager: remove allowAutorun expire timeout on volume removal
- Date: Sun, 17 Feb 2019 17:31:52 +0000 (UTC)
commit 2f24e0701e3fef133276f04f9eb70f15c0477915
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Wed Jul 4 16:55:28 2018 +0200
automountManager: remove allowAutorun expire timeout on volume removal
If the volume is removed before AUTORUN_EXPIRE_TIMEOUT_SECS seconds, we can stop
the timeout earlier as there's nothing to unset, while the volume instance
won't be valid anymore.
https://bugzilla.gnome.org/show_bug.cgi?id=791233
js/ui/components/automountManager.js | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/js/ui/components/automountManager.js b/js/ui/components/automountManager.js
index 2d8f3f8fb..a6cd85792 100644
--- a/js/ui/components/automountManager.js
+++ b/js/ui/components/automountManager.js
@@ -210,6 +210,10 @@ var AutomountManager = new Lang.Class({
},
_onVolumeRemoved(monitor, volume) {
+ if (volume._allowAutorunExpireId && volume._allowAutorunExpireId > 0) {
+ Mainloop.source_remove(volume._allowAutorunExpireId);
+ delete volume._allowAutorunExpireId;
+ }
this._volumeQueue =
this._volumeQueue.filter(element => (element != volume));
},
@@ -234,8 +238,10 @@ var AutomountManager = new Lang.Class({
_allowAutorunExpire(volume) {
let id = Mainloop.timeout_add_seconds(AUTORUN_EXPIRE_TIMEOUT_SECS, () => {
volume.allowAutorun = false;
+ delete volume._allowAutorunExpireId;
return GLib.SOURCE_REMOVE;
});
+ volume._allowAutorunExpireId = id;
GLib.Source.set_name_by_id(id, '[gnome-shell] volume.allowAutorun');
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]