Linux fix patch from Dmitry Vyukov.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151072 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/POSIX/ProcessPOSIX.cpp b/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
index 67cf8a9..68ffc2f 100644
--- a/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
+++ b/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
@@ -500,8 +500,10 @@
// FIXME: We should be using tid, not pid.
assert(m_monitor);
ThreadSP thread_sp (old_thread_list.FindThreadByID (GetID(), false));
- if (!thread_sp)
- thread_sp.reset(new POSIXThread(*this, GetID()));
+ if (!thread_sp) {
+ ProcessSP me = this->shared_from_this();
+ thread_sp.reset(new POSIXThread(me, GetID()));
+ }
if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))
log->Printf ("ProcessPOSIX::%s() updated pid = %i", __FUNCTION__, GetID());