* linux-low.c (linux_kill): Handle being called with no threads.
[deliverable/binutils-gdb.git] / gdb / gdbserver / win32-i386-low.c
index de6ef0b84610382878ca71981ae05edea7627dfc..ee2d2d19c04966c44e1d7a745526a969fa77c413 100644 (file)
@@ -582,6 +582,9 @@ win32_attach (unsigned long pid)
 static void
 win32_kill (void)
 {
+  if (current_process_handle == NULL)
+    return;
+
   TerminateProcess (current_process_handle, 0);
   for (;;)
     {
@@ -901,6 +904,7 @@ in:
       ourstatus->kind = TARGET_WAITKIND_EXITED;
       ourstatus->value.integer = current_event.u.ExitProcess.dwExitCode;
       CloseHandle (current_process_handle);
+      current_process_handle = NULL;
       retval = main_thread_id;
       break;
 
This page took 0.025872 seconds and 4 git commands to generate.