Skip to content

Commit

Permalink
Refs #4333. Ensure memory is cleared up.
Browse files Browse the repository at this point in the history
Force shared ptr to drop references to that workspaces are cleaned up
in a more timely fashion.
  • Loading branch information
martyngigg committed Jan 11, 2012
1 parent 8a13162 commit a54b005
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Code/Mantid/Framework/API/src/FrameworkManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ bool FrameworkManagerImpl::deleteWorkspace(const std::string& wsName)
// selected workspace is a group workspace
ws_grpsptr->deepRemoveAll();
}
// Make sure we drop the references so the memory will get freed when we expect it to
ws_sptr.reset();
ws_grpsptr.reset();
try
{
AnalysisDataService::Instance().remove(wsName);
Expand All @@ -261,6 +264,7 @@ bool FrameworkManagerImpl::deleteWorkspace(const std::string& wsName)
g_log.error()<<"Workspace "<< wsName << " could not be found."<<std::endl;
retVal = false;
}
Mantid::API::MemoryManager::Instance().releaseFreeMemory();
return retVal;
}

Expand Down

0 comments on commit a54b005

Please sign in to comment.