Correzione sulla TAssoc_array::add() eseguita per reference: non

memorizzava il puntatore dell'oggetto duplicato.


git-svn-id: svn://10.65.10.50/trunk@4200 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
angelo 1997-03-14 08:10:08 +00:00
parent 6d3af133ad
commit f1cccccc5f

View File

@ -32,12 +32,15 @@ THash_object* TAssoc_array::_lookup(
break;
}
if (o == NULL && insert)
if (o == NULL)
{
o = new THash_object(key);
arr.insert(o,i);
if (insert)
{
o = new THash_object(key);
arr.insert(o,i);
_cnt++;
}
isnew = TRUE;
_cnt++;
}
return o;
@ -156,7 +159,7 @@ bool TAssoc_array::add(
bool TAssoc_array::add(const char* key, const TObject& obj, bool force)
{
bool isnew = FALSE;
THash_object* o = _lookup(key,isnew,TRUE);
THash_object* o = _lookup(key,isnew,FALSE); // Non inserire l'Hash_object se non lo trovi (ci pensa la add sotto)
if (!isnew && !force)
return TRUE;