bug updates name index when an object has been deleted

(cherry picked from commit 4c298351d7)
This commit is contained in:
Ruben S. Montero committed 2013-04-12 21:17:07 +02:00
1 parent 5a21a49c7a
commit 8296199bb7
1 file changed
+13 -13
+13 -13
View File
@@ -306,19 +306,6 @@ PoolObjectSQL * PoolSQL::get(const string& name, int ouid, bool olock)
}
else
{
objectsql = create();
rc = objectsql->select(db,name,ouid);
if ( rc != 0 )
{
delete objectsql;
unlock();
return 0;
}
if ( index != name_pool.end() && index->second->isValid() == false )
{
index->second->lock();
@@ -332,6 +319,19 @@ PoolObjectSQL * PoolSQL::get(const string& name, int ouid, bool olock)
delete tmp_ptr;
}
objectsql = create();
rc = objectsql->select(db,name,ouid);
if ( rc != 0 )
{
delete objectsql;
unlock();
return 0;
}
string okey = key(objectsql->name,objectsql->uid);
pool.insert(make_pair(objectsql->oid, objectsql));