mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-17 13:01:42 +00:00
Fixed: Memory leak
This commit is contained in:
parent
6c1cf58572
commit
05d06ae702
1 changed files with 18 additions and 11 deletions
|
@ -132,18 +132,26 @@ void CCDBSynchronised::read( const string &fileName )
|
||||||
|
|
||||||
// value
|
// value
|
||||||
token = strtok(buffer," \t");
|
token = strtok(buffer," \t");
|
||||||
if( token == NULL ) continue;
|
|
||||||
sint64 value;
|
|
||||||
fromString((const char*)token, value);
|
|
||||||
|
|
||||||
// property name
|
if (token)
|
||||||
token = strtok(NULL," \n");
|
{
|
||||||
if( token == NULL ) continue;
|
sint64 value;
|
||||||
string propName(token);
|
fromString((const char*)token, value);
|
||||||
|
|
||||||
// set the value of the property
|
// property name
|
||||||
ICDBNode::CTextId txtId(propName);
|
token = strtok(NULL," \n");
|
||||||
_Database->setProp(txtId,value);
|
|
||||||
|
if (token)
|
||||||
|
{
|
||||||
|
string propName(token);
|
||||||
|
|
||||||
|
// set the value of the property
|
||||||
|
ICDBNode::CTextId txtId(propName);
|
||||||
|
_Database->setProp(txtId, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete [] buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
f.close();
|
f.close();
|
||||||
|
@ -177,7 +185,6 @@ void CCDBSynchronised::write( const string &fileName )
|
||||||
{
|
{
|
||||||
nlwarning("<CCDBSynchronised::write> can't write %s : the database has not been initialized",fileName.c_str());
|
nlwarning("<CCDBSynchronised::write> can't write %s : the database has not been initialized",fileName.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // write //
|
} // write //
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue