[gnome-music/wip/mschraal/grilo-destructor: 65/65] coregrilo: Deinitialize Grilo on shutdown
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/grilo-destructor: 65/65] coregrilo: Deinitialize Grilo on shutdown
- Date: Mon, 18 May 2020 15:11:06 +0000 (UTC)
commit a95e8c18c2300d61ebea149a0c8cc0a8af17c988
Author: Marinus Schraal <mschraal gnome org>
Date: Sun Mar 29 23:19:08 2020 +0200
coregrilo: Deinitialize Grilo on shutdown
Always call Grl.deinit() on shutdown.
Related: #82
gnomemusic/coregrilo.py | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/gnomemusic/coregrilo.py b/gnomemusic/coregrilo.py
index 47c72383..a7a4936e 100644
--- a/gnomemusic/coregrilo.py
+++ b/gnomemusic/coregrilo.py
@@ -22,6 +22,8 @@
# code, but you are not obligated to do so. If you do not wish to do so,
# delete this exception statement from your version.
+import weakref
+
import gi
gi.require_version('Grl', '0.3')
from gi.repository import Grl, GLib, GObject
@@ -89,6 +91,8 @@ class CoreGrilo(GObject.GObject):
self._registry.load_all_plugins(True)
+ weakref.finalize(self, Grl.deinit)
+
def _on_tracker_available_changed(self, klass, value):
new_state = self._tracker_wrapper.props.tracker_available
# FIXME:No removal support yet.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]