Fix saving torrent state on fresh configs
Do not try to call doIteration() on the reactor if it has already stopped
This commit is contained in:
parent
e0111271a3
commit
a3636ccdb7
|
@ -132,6 +132,10 @@ class TorrentManager(component.Component):
|
||||||
# Get the core config
|
# Get the core config
|
||||||
self.config = ConfigManager("core.conf")
|
self.config = ConfigManager("core.conf")
|
||||||
|
|
||||||
|
# Make sure the state folder has been created
|
||||||
|
if not os.path.exists(os.path.join(get_config_dir(), "state")):
|
||||||
|
os.makedirs(os.path.join(get_config_dir(), "state"))
|
||||||
|
|
||||||
# Create the torrents dict { torrent_id: Torrent }
|
# Create the torrents dict { torrent_id: Torrent }
|
||||||
self.torrents = {}
|
self.torrents = {}
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ class GtkUI(object):
|
||||||
|
|
||||||
# Process any pending gtk events since the mainloop has been quit
|
# Process any pending gtk events since the mainloop has been quit
|
||||||
if not deluge.common.windows_check():
|
if not deluge.common.windows_check():
|
||||||
while gtk.events_pending():
|
while gtk.events_pending() and reactor.running:
|
||||||
reactor.doIteration(0)
|
reactor.doIteration(0)
|
||||||
|
|
||||||
# Shutdown all components
|
# Shutdown all components
|
||||||
|
|
Loading…
Reference in New Issue