Skip to content
This repository was archived by the owner on Aug 28, 2020. It is now read-only.

Commit 55dd39c

Browse files
committed
move some debugger decisions to debugger from the main app
1 parent 1f908d1 commit 55dd39c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pugdebug/debugger.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ def stop_debug(self):
156156
def detach_debug(self):
157157
"""Detach a debugging session
158158
"""
159-
self.current_connection.detach()
159+
if self.is_connected():
160+
self.current_connection.detach()
160161

161162
def handle_server_stopped(self):
162163
"""Handle when server gets disconnected
@@ -166,6 +167,8 @@ def handle_server_stopped(self):
166167
if self.has_pending_connections():
167168
self.start_new_connection()
168169
else:
170+
self.cleanup()
171+
169172
self.debugging_stopped_signal.emit()
170173

171174
def run_debug(self):

pugdebug/pugdebug.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,6 @@ def handle_debugging_stopped(self):
369369
This handler should be called when the connection to
370370
xdebug is terminated.
371371
"""
372-
self.debugger.cleanup()
373-
374372
# Only set breakpoints as init_breakpoints
375373
# if there are any breakpoints set
376374
if len(self.breakpoints) > 0:
@@ -389,8 +387,7 @@ def detach_debug(self):
389387
The debugging session will end, but the debuged script
390388
will terminate normally.
391389
"""
392-
if self.debugger.is_connected():
393-
self.debugger.detach_debug()
390+
self.debugger.detach_debug()
394391

395392
def handle_step_command(self):
396393
"""Handle step command

0 commit comments

Comments
 (0)