Fix segfault: uninitialized identifiers w/ &synchronized (addresses #66)

Synchronization of state between connecting peers now skips over
identifiers that aren't initialized with a value yet.  If they're
assigned a value later, that will be synchronized like usual.
This commit is contained in:
Jon Siwek 2012-12-05 12:36:09 -06:00
parent 32239ea633
commit f403e537ec
4 changed files with 18 additions and 3 deletions

View file

@ -1032,6 +1032,14 @@ bool RemoteSerializer::SendAllSynchronized(Peer* peer, SerialInfo* info)
for ( ; index < sync_ids.length(); ++index )
{
if ( ! sync_ids[index]->ID_Val() )
{
#ifdef DEBUG
DBG_LOG(DBG_COMM, "Skip sync of ID with null value: %s\n",
sync_ids[index]->Name());
#endif
continue;
}
cont->SaveContext();
StateAccess sa(OP_ASSIGN, sync_ids[index],