@@ -128,21 +128,15 @@ def connect_connection_signals(self, connection):
128128 self .handle_connection_error
129129 )
130130
131- def cleanup (self ):
132- """Cleanup debugger when it's done
131+ def cleanup_current_connection (self ):
132+ """Cleanup the current debugger connection
133133
134- If there is an active connection, disconnect from it and clear
135- all the remaining connections.
136-
137- Stop the server from listening.
134+ If there is an active connection, disconnect from it.
138135
139136 Clean up attributes.
140137 """
141138 if self .is_connected ():
142139 self .current_connection .disconnect ()
143- self .connections .clear ()
144-
145- self .server .stop ()
146140
147141 self .current_connection = None
148142 self .step_result = ''
@@ -208,13 +202,9 @@ def handle_post_start(self):
208202
209203 def handle_server_stopped (self ):
210204 """Handle when the server is stopped
211-
212- If the current connection is terminated, cleanup the debugging
213- session and emit the debugging stopped signal.
214205 """
215206 if not self .is_connected ():
216- self .cleanup ()
217- self .debugging_stopped_signal .emit ()
207+ pass
218208
219209 def stop_debug (self ):
220210 """Stop a debugging session
@@ -224,8 +214,6 @@ def stop_debug(self):
224214 """
225215 if self .is_connected ():
226216 self .current_connection .stop ()
227- else :
228- self .server .stop ()
229217
230218 def detach_debug (self ):
231219 """Detach the current connection
@@ -238,13 +226,12 @@ def handle_stopped(self):
238226
239227 If there are pending connections, start a new one.
240228
241- Otherwise clean up and emit a server stopped signal.
229+ Otherwise emit a debugging stopped signal.
242230 """
243231 if self .has_pending_connections ():
244232 self .start_debugging_new_connection ()
245233 else :
246- self .cleanup ()
247-
234+ self .cleanup_current_connection ()
248235 self .debugging_stopped_signal .emit ()
249236
250237 def run_debug (self ):
0 commit comments