I am using a small library to have a database connection pool.
However, when I run the provided example, at the point where it calls DestroyPool I get a map is not increment-able assertion fail.
Here is the code
template <typename T>
int CommonDatabasePool<T>::DestroyPool(){
typename map<T*, short>::iterator iter;
for( iter = poolmap.begin(); !poolmap.empty()&& iter != poolmap.end(); iter++ ) {
if(iter->second == DBPOOL_POOLEDCON_FREE){
MyReleaseConcreteConnection(iter->first);
poolmap.erase(iter);
}
}
exitkeepalivepool = true;
if(XSemPost(&semhandle)==-1){
}
if(XThreadJoin(&threadhandle)==-1){
}
return poolmap.size();
}
Is there anything here that looks suspicious that might cause such an error?
Whether or not I even use any connections it still does this...
Thanks