Catch and log ReactorNotRunning when stopping reactor in gtk
This commit is contained in:
parent
62c7209558
commit
40e4fb9b8e
|
@ -274,7 +274,7 @@ class GtkUI(object):
|
|||
def on_dialog_response(response):
|
||||
if response != gtk.RESPONSE_YES:
|
||||
# The user does not want to turn Classic Mode off, so just quit
|
||||
reactor.stop()
|
||||
self.mainwindow.quit()
|
||||
return
|
||||
# Turning off classic_mode
|
||||
self.config["classic_mode"] = False
|
||||
|
|
|
@ -153,7 +153,7 @@ class IPCInterface(component.Component):
|
|||
def connect_failed(self, args):
|
||||
# This gets called when we're unable to do a connectUNIX to the ipc
|
||||
# socket. We'll delete the lock and socket files and start up Deluge.
|
||||
#reactor.stop()
|
||||
|
||||
socket = os.path.join(deluge.configmanager.get_config_dir("ipc"), "deluge-gtk")
|
||||
if os.path.exists(socket):
|
||||
try:
|
||||
|
|
|
@ -47,6 +47,7 @@ import deluge.component as component
|
|||
from deluge.configmanager import ConfigManager
|
||||
from deluge.ui.gtkui.ipcinterface import process_args
|
||||
from twisted.internet import reactor
|
||||
from twisted.internet.error import ReactorNotRunning
|
||||
|
||||
import deluge.common
|
||||
import common
|
||||
|
@ -218,7 +219,10 @@ class MainWindow(component.Component):
|
|||
"""
|
||||
if shutdown:
|
||||
def on_daemon_shutdown(result):
|
||||
reactor.stop()
|
||||
try:
|
||||
reactor.stop()
|
||||
except ReactorNotRunning:
|
||||
log.debug("Attempted to stop the reactor but it is not running...")
|
||||
client.daemon.shutdown().addCallback(on_daemon_shutdown)
|
||||
return
|
||||
if client.is_classicmode():
|
||||
|
|
Loading…
Reference in New Issue