Skip to content

Instantly share code, notes, and snippets.

@Zerophase
Last active May 27, 2016 17:52
Show Gist options
  • Save Zerophase/aee0e2ebadf211256dde3f8a275e2389 to your computer and use it in GitHub Desktop.
Save Zerophase/aee0e2ebadf211256dde3f8a275e2389 to your computer and use it in GitHub Desktop.
TinyXML2 segfault
c = content->FirstChildElement("Connection");
while(dialogues[0] != nullptr) // rewrite to iterate to the next dialogue
{
if(c->FirstChildElement("Source")->Attribute("IdRef", rightTarget.front().c_str()))
connectionNodes.push_back(c);
if(c != nullptr)
c = c->NextSiblingElement("Connection");
if(c == nullptr)
{
FindDialogueChildren(dialogues, connectionNodes, orderedNodes, sourceCount, childTypes);
c = content->FirstChildElement("Connection"); // segfault occurs here third time it is hit.
while(c != nullptr)
{
while(c != nullptr && !c->FirstChildElement("Source")->Attribute("IdRef", id.c_str()))
{
c = c->NextSiblingElement("Connection");
}
if(c != nullptr)
{
connectionNodes.push_back(c);
c = c->NextSiblingElement("Connection");
}
}
c = content->FirstChildElement("Connection');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment