+2009-04-30 Doug Evans <dje@google.com>
+
+ * inferiors.c (remove_process): Fix memory leak, free process.
+ * linux-low.c (linux_remove_process): New function.
+ (linux_kill): Call it instead of remove_process.
+ (linux_detach, linux_wait_1): Ditto.
+
2009-04-19 Danny Backx <dannybackx@users.sourceforge.net>
* configure.srv: Add x86 Windows CE target.
return process;
}
+/* Remove a process from the common process list and free the memory
+ allocated for it.
+ The caller is responsible for freeing private data first. */
+
void
remove_process (struct process_info *process)
{
clear_symbol_cache (&process->symbol_cache);
free_all_breakpoints (process);
remove_inferior (&all_processes, &process->head);
+ free (process);
}
struct process_info *
return proc;
}
+/* Remove a process from the common process list,
+ also freeing all private data. */
+
+static void
+linux_remove_process (struct process_info *process)
+{
+ free (process->private);
+ remove_process (process);
+}
+
/* Handle a GNU/Linux extended wait response. If we see a clone
event, we need to add the new LWP to our list (and not report the
trap to higher layers). */
} while (lwpid > 0 && WIFSTOPPED (wstat));
delete_lwp (lwp);
- remove_process (process);
+ linux_remove_process (process);
return 0;
}
delete_all_breakpoints ();
find_inferior (&all_threads, linux_detach_one_lwp, &pid);
- remove_process (process);
+ linux_remove_process (process);
return 0;
}
struct process_info *process = find_process_pid (pid);
delete_lwp (lwp);
- remove_process (process);
+ linux_remove_process (process);
current_inferior = NULL;