Fixed: Memory leak

--HG--
branch : develop
feature/pipeline-tools
kervala 9 years ago
parent 79be594f54
commit c0fe37ab8e

@ -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; if (token)
fromString((const char*)token, value); {
sint64 value;
// property name fromString((const char*)token, value);
token = strtok(NULL," \n");
if( token == NULL ) continue; // property name
string propName(token); token = strtok(NULL," \n");
// set the value of the property if (token)
ICDBNode::CTextId txtId(propName); {
_Database->setProp(txtId,value); 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…
Cancel
Save