Fix iterator invalidation bug, identified by Coverity.

llvm-svn: 28257
This commit is contained in:
Chris Lattner 2006-05-12 18:13:11 +00:00
parent 1fe2d2c600
commit 1971e8a77b
2 changed files with 2 additions and 1 deletions

View File

@ -93,6 +93,7 @@ DynamicLibrary::~DynamicLibrary() {
if (*I == a_handle) {
// Note: don't use the swap/pop_back trick here. Order is important.
OpenedHandles.erase(I);
return;
}
}
}

View File

@ -95,7 +95,7 @@ Process::GetTimeUsage(TimeValue& elapsed, TimeValue& user_time,
TimeValue& sys_time)
{
elapsed = TimeValue::now();
#if defined(HAVE_GETRUSAGE)
#if 0 // defined(HAVE_GETRUSAGE)
struct rusage usage;
::getrusage(RUSAGE_SELF, &usage);
user_time = TimeValue(