minor cleanup

git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/trunk@7706 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
Scott R Charlton 2013-05-10 23:10:46 +00:00
parent 21898660f9
commit 5a169287f8
2 changed files with 6 additions and 10 deletions

View File

@ -3,7 +3,6 @@
#include "IPhreeqc.hpp" // IPhreeqc #include "IPhreeqc.hpp" // IPhreeqc
#include "Phreeqc.h" // Phreeqc #include "Phreeqc.h" // Phreeqc
#define _INC_PHREEQC_H
#include "thread.h" #include "thread.h"
#include "Debug.h" // ASSERT #include "Debug.h" // ASSERT
@ -43,7 +42,6 @@ IPhreeqc::IPhreeqc(void)
, PhreeqcPtr(0) , PhreeqcPtr(0)
, input_file(0) , input_file(0)
, database_file(0) , database_file(0)
/* , Index(IPhreeqc::InstancesIndex++) */
{ {
char buffer[80]; char buffer[80];

View File

@ -932,17 +932,15 @@ IPhreeqcLib::DestroyIPhreeqc(int id)
IPhreeqc* IPhreeqc*
IPhreeqcLib::GetInstance(int id) IPhreeqcLib::GetInstance(int id)
{ {
std::map<size_t, IPhreeqc*>::iterator it; IPhreeqc* instance = 0;
bool found=false;
mutex_lock(&map_lock); mutex_lock(&map_lock);
it = IPhreeqc::Instances.find(size_t(id)); std::map<size_t, IPhreeqc*>::iterator it = IPhreeqc::Instances.find(size_t(id));
found = (it != IPhreeqc::Instances.end()); if (it != IPhreeqc::Instances.end())
mutex_unlock(&map_lock);
if (found)
{ {
return (*it).second; instance = (*it).second;
} }
return 0; mutex_unlock(&map_lock);
return instance;
} }
//// static method //// static method
//void IPhreeqcLib::CleanupIPhreeqcInstances(void) //void IPhreeqcLib::CleanupIPhreeqcInstances(void)