Call SBDebugger::Initialize/Terminate from within Create/Destroy.

The above change permits developers using the lldb C++ API to
code applications in a more logical manner.

llvm-svn: 219102
This commit is contained in:
Matthew Gardiner 2014-10-06 05:22:29 +00:00
parent fd58072675
commit 64ee99183b
1 changed files with 4 additions and 0 deletions

View File

@ -159,6 +159,8 @@ SBDebugger::Create(bool source_init_files, lldb::LogOutputCallback callback, voi
{ {
Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
Initialize();
SBDebugger debugger; SBDebugger debugger;
// Currently we have issues if this function is called simultaneously on two different // Currently we have issues if this function is called simultaneously on two different
@ -210,6 +212,8 @@ SBDebugger::Destroy (SBDebugger &debugger)
sstr.GetData()); sstr.GetData());
} }
Terminate();
Debugger::Destroy (debugger.m_opaque_sp); Debugger::Destroy (debugger.m_opaque_sp);
if (debugger.m_opaque_sp.get() != NULL) if (debugger.m_opaque_sp.get() != NULL)