Catch and log ReactorNotRunning when stopping reactor in gtk

This commit is contained in:
Calum Lind 2012-02-19 16:44:12 +00:00
commit 7847362dbb
4 changed files with 15 additions and 11 deletions

View file

@ -289,7 +289,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

View file

@ -151,7 +151,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:

View file

@ -45,6 +45,7 @@ import deluge.component as component
from deluge.configmanager import ConfigManager
from deluge.ui.gtkui.ipcinterface import process_args
from twisted.internet import reactor, defer
from twisted.internet.error import ReactorNotRunning
import deluge.common
import common
@ -165,7 +166,10 @@ class MainWindow(component.Component):
return client.disconnect()
def stop_reactor(result):
return reactor.stop()
try:
reactor.stop()
except ReactorNotRunning:
log.debug("Attempted to stop the reactor but it is not running...")
def log_failure(failure, action):
log.error("Encountered error attempting to %s: %s" % \