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