diff --git a/src/IPhreeqc.cpp b/src/IPhreeqc.cpp index e85fb207..33bfa1ce 100644 --- a/src/IPhreeqc.cpp +++ b/src/IPhreeqc.cpp @@ -3,7 +3,6 @@ #include "IPhreeqc.hpp" // IPhreeqc #include "Phreeqc.h" // Phreeqc -#define _INC_PHREEQC_H #include "thread.h" #include "Debug.h" // ASSERT @@ -43,7 +42,6 @@ IPhreeqc::IPhreeqc(void) , PhreeqcPtr(0) , input_file(0) , database_file(0) -/* , Index(IPhreeqc::InstancesIndex++) */ { char buffer[80]; diff --git a/src/IPhreeqcLib.cpp b/src/IPhreeqcLib.cpp index 866425a7..81d82a69 100644 --- a/src/IPhreeqcLib.cpp +++ b/src/IPhreeqcLib.cpp @@ -932,17 +932,15 @@ IPhreeqcLib::DestroyIPhreeqc(int id) IPhreeqc* IPhreeqcLib::GetInstance(int id) { - std::map::iterator it; - bool found=false; + IPhreeqc* instance = 0; mutex_lock(&map_lock); - it = IPhreeqc::Instances.find(size_t(id)); - found = (it != IPhreeqc::Instances.end()); - mutex_unlock(&map_lock); - if (found) + std::map::iterator it = IPhreeqc::Instances.find(size_t(id)); + if (it != IPhreeqc::Instances.end()) { - return (*it).second; + instance = (*it).second; } - return 0; + mutex_unlock(&map_lock); + return instance; } //// static method //void IPhreeqcLib::CleanupIPhreeqcInstances(void)