@@ -528,12 +528,13 @@ bool ThreadList::WillResume() {
528528 bool wants_solo_run = false ;
529529
530530 for (pos = m_threads.begin (); pos != end; ++pos) {
531- lldbassert ((*pos)->GetCurrentPlan () &&
531+ ThreadSP thread_sp (*pos);
532+ lldbassert (thread_sp->GetCurrentPlan () &&
532533 " thread should not have null thread plan" );
533- if ((*pos) ->GetResumeState () != eStateSuspended &&
534- (*pos) ->GetCurrentPlan ()->StopOthers ()) {
535- if ((*pos) ->IsOperatingSystemPluginThread () &&
536- !(*pos) ->GetBackingThread ())
534+ if (thread_sp ->GetResumeState () != eStateSuspended &&
535+ thread_sp ->GetCurrentPlan ()->StopOthers ()) {
536+ if (thread_sp ->IsOperatingSystemPluginThread () &&
537+ !thread_sp ->GetBackingThread ())
537538 continue ;
538539 wants_solo_run = true ;
539540 break ;
@@ -546,12 +547,13 @@ bool ThreadList::WillResume() {
546547 // others, only call setup on the threads that request StopOthers...
547548
548549 for (pos = m_threads.begin (); pos != end; ++pos) {
549- if ((*pos)->GetResumeState () != eStateSuspended &&
550- (!wants_solo_run || (*pos)->GetCurrentPlan ()->StopOthers ())) {
551- if ((*pos)->IsOperatingSystemPluginThread () &&
552- !(*pos)->GetBackingThread ())
550+ ThreadSP thread_sp (*pos);
551+ if (thread_sp->GetResumeState () != eStateSuspended &&
552+ (!wants_solo_run || thread_sp->GetCurrentPlan ()->StopOthers ())) {
553+ if (thread_sp->IsOperatingSystemPluginThread () &&
554+ !thread_sp->GetBackingThread ())
553555 continue ;
554- (*pos) ->SetupForResume ();
556+ thread_sp ->SetupForResume ();
555557 }
556558 }
557559
@@ -574,8 +576,8 @@ bool ThreadList::WillResume() {
574576 ThreadSP thread_sp (*pos);
575577 if (thread_sp->GetResumeState () != eStateSuspended &&
576578 thread_sp->GetCurrentPlan ()->StopOthers ()) {
577- if ((*pos) ->IsOperatingSystemPluginThread () &&
578- !(*pos) ->GetBackingThread ())
579+ if (thread_sp ->IsOperatingSystemPluginThread () &&
580+ !thread_sp ->GetBackingThread ())
579581 continue ;
580582
581583 // You can't say "stop others" and also want yourself to be suspended.
0 commit comments