diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index f0bd9e3260e6..3380d0e45ee3 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -874,6 +874,9 @@ Process::Finalize() m_instrumentation_runtimes.clear(); m_next_event_action_ap.reset(); m_stop_info_override_callback = NULL; + // Clear the last natural stop ID since it has a strong + // reference to this process + m_mod_id.SetStopEventForLastNaturalStopID(EventSP()); //#ifdef LLDB_CONFIGURATION_DEBUG // StreamFile s(stdout, false); // EventSP event_sp; @@ -1467,6 +1470,10 @@ Process::SetExitStatus (int status, const char *cstr) m_process_input_reader.reset(); } + // Clear the last natural stop ID since it has a strong + // reference to this process + m_mod_id.SetStopEventForLastNaturalStopID(EventSP()); + SetPrivateState (eStateExited); // Allow subclasses to do some cleanup