Modified all logging calls to hand out shared pointers to make sure we

don't crash if we disable logging when some code already has a copy of the
logger. Prior to this fix, logs were handed out as pointers and if they were
held onto while a log got disabled, then it could cause a crash. Now all logs
are handed out as shared pointers so this problem shouldn't happen anymore.
We are also using our new shared pointers that put the shared pointer count
and the object into the same allocation for a tad better performance.

llvm-svn: 118319
This commit is contained in:
Greg Clayton committed 2010-11-06 01:53:30 +00:00
1 parent 8e3d95e7df
commit 2d4edfbc6a
98 files changed
+586 -565

No files matched your search

+2 -2
View File
@@ -62,7 +62,7 @@ SBFunction::GetName() const
if (m_opaque_ptr)
cstr = m_opaque_ptr->GetMangled().GetName().AsCString();
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
if (log)
{
if (cstr)
@@ -79,7 +79,7 @@ SBFunction::GetMangledName () const
const char *cstr = NULL;
if (m_opaque_ptr)
cstr = m_opaque_ptr->GetMangled().GetMangledName().AsCString();
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
if (log)
{
if (cstr)