diff options
| author | Jim Ingham <jingham@apple.com> | 2011-01-29 04:05:41 +0000 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2011-01-29 04:05:41 +0000 |
| commit | 754ab98fae3b5955779b9d556a78b9c7f13e53e7 (patch) | |
| tree | bb17dba2055635d37e00d77e5fb025a1ee0ba378 | |
| parent | 1ae64c5a9d1de20e0f321649f17708e95b3fda1a (diff) | |
| download | bcm5719-llvm-754ab98fae3b5955779b9d556a78b9c7f13e53e7.tar.gz bcm5719-llvm-754ab98fae3b5955779b9d556a78b9c7f13e53e7.zip | |
The m_next_action is simpler if it is an auto_pointer.
llvm-svn: 124525
| -rw-r--r-- | lldb/include/lldb/Target/Process.h | 12 | ||||
| -rw-r--r-- | lldb/source/Target/Process.cpp | 10 |
2 files changed, 9 insertions, 13 deletions
diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h index 78d5be90bcb..a884e20c711 100644 --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -1823,12 +1823,10 @@ protected: void SetNextEventAction (Process::NextEventAction *next_event_action) { - if (m_next_event_action) - { - m_next_event_action->HandleBeingUnshipped(); - delete m_next_event_action; - } - m_next_event_action = next_event_action; + if (m_next_event_action_ap.get()) + m_next_event_action_ap->HandleBeingUnshipped(); + + m_next_event_action_ap.reset(next_event_action); } // This is the completer for Attaching: @@ -1920,7 +1918,7 @@ protected: typedef std::map<lldb::LanguageType, lldb::LanguageRuntimeSP> LanguageRuntimeCollection; LanguageRuntimeCollection m_language_runtimes; - NextEventAction *m_next_event_action; + std::auto_ptr<NextEventAction> *m_next_event_action_ap; size_t RemoveBreakpointOpcodesFromBuffer (lldb::addr_t addr, size_t size, uint8_t *buf) const; diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 9b0194951c1..46f3a4721ba 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -238,7 +238,7 @@ Process::Process(Target &target, Listener &listener) : m_stdio_communication_mutex (Mutex::eMutexTypeRecursive), m_stdout_data (), m_memory_cache (), - m_next_event_action(NULL) + m_next_event_action_ap(NULL) { UpdateInstanceName(); @@ -274,8 +274,6 @@ Process::~Process() LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); if (log) log->Printf ("%p Process::~Process()", this); - if (m_next_event_action) - SetNextEventAction(NULL); StopPrivateStateThread(); } @@ -2142,9 +2140,9 @@ Process::HandlePrivateEvent (EventSP &event_sp) const StateType new_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get()); // First check to see if anybody wants a shot at this event: - if (m_next_event_action != NULL) + if (m_next_event_action_ap.get() != NULL) { - NextEventAction::EventActionResult action_result = m_next_event_action->PerformAction(event_sp); + NextEventAction::EventActionResult action_result = m_next_event_action_ap->PerformAction(event_sp); switch (action_result) { case NextEventAction::eEventActionSuccess: @@ -2159,7 +2157,7 @@ Process::HandlePrivateEvent (EventSP &event_sp) if (new_state != eStateExited) { // FIXME: should cons up an exited event, and discard this one. - SetExitStatus(0, m_next_event_action->GetExitString()); + SetExitStatus(0, m_next_event_action_ap->GetExitString()); SetNextEventAction(NULL); return; } |

