[gnome-music/wip/jfelder/tracker3] coregrilo: Fix possible timeout crash
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/tracker3] coregrilo: Fix possible timeout crash
- Date: Mon, 24 Aug 2020 12:51:39 +0000 (UTC)
commit ff62f97bcfd86b0fafed3a195b24b34115e346e1
Author: Marinus Schraal <mschraal gnome org>
Date: Mon Aug 24 14:31:12 2020 +0200
coregrilo: Fix possible timeout crash
A crash would occur if TrackerWrapper had a timeout during set-up;
CoreGrilo might already be intializing while TrackerWrapper has
miner_fs_busname still as None. miner_fs_busname is used to setup the
Grilo Tracker configuration during intialization.
Only set up the Grilo Tracker configuration when really loading the
Tracker source to avoid this issue.
gnomemusic/coregrilo.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gnomemusic/coregrilo.py b/gnomemusic/coregrilo.py
index 1e896327..9a3d67a0 100644
--- a/gnomemusic/coregrilo.py
+++ b/gnomemusic/coregrilo.py
@@ -86,13 +86,6 @@ class CoreGrilo(GObject.GObject):
config.set_api_key(self._theaudiodb_api_key)
self._registry.add_config(config)
- config = Grl.Config.new("grl-tracker3", "grl-tracker3-source")
- config.set_string(
- "miner-service", self._tracker_wrapper.miner_fs_busname())
- config.set_string(
- "store-path", self._tracker_wrapper.cache_directory())
- self._registry.add_config(config)
-
self._registry.connect('source-added', self._on_source_added)
self._registry.connect('source-removed', self._on_source_removed)
@@ -104,6 +97,13 @@ class CoreGrilo(GObject.GObject):
new_state = self._tracker_wrapper.props.tracker_available
# FIXME:No removal support yet.
if new_state == TrackerState.AVAILABLE:
+ config = Grl.Config.new("grl-tracker3", "grl-tracker3-source")
+ config.set_string(
+ "miner-service", self._tracker_wrapper.miner_fs_busname())
+ config.set_string(
+ "store-path", self._tracker_wrapper.cache_directory())
+ self._registry.add_config(config)
+
tracker_plugin = self._registry.lookup_plugin("grl-tracker3")
if tracker_plugin:
self._registry.unload_plugin("grl-tracker3")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]