summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Process.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r--lldb/source/Target/Process.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index c347781f6bd..9bd5dfe916b 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -4065,8 +4065,8 @@ Process::StartPrivateStateThread (bool is_secondary_thread)
}
// Create the private state thread, and start it running.
- PrivateStateThreadArgs args = {this, is_secondary_thread};
- m_private_state_thread = ThreadLauncher::LaunchThread(thread_name, Process::PrivateStateThread, (void *) &args, NULL, 8 * 1024 * 1024);
+ PrivateStateThreadArgs *args_ptr = new PrivateStateThreadArgs(this, is_secondary_thread);
+ m_private_state_thread = ThreadLauncher::LaunchThread(thread_name, Process::PrivateStateThread, (void *) args_ptr, NULL, 8 * 1024 * 1024);
if (m_private_state_thread.IsJoinable())
{
ResumePrivateStateThread();
@@ -4308,8 +4308,9 @@ Process::HaltPrivate()
thread_result_t
Process::PrivateStateThread (void *arg)
{
- PrivateStateThreadArgs *real_args = static_cast<PrivateStateThreadArgs *> (arg);
- thread_result_t result = real_args->process->RunPrivateStateThread(real_args->is_secondary_thread);
+ PrivateStateThreadArgs real_args = *static_cast<PrivateStateThreadArgs *> (arg);
+ free (arg);
+ thread_result_t result = real_args.process->RunPrivateStateThread(real_args.is_secondary_thread);
return result;
}
OpenPOWER on IntegriCloud