Fix: VS2010 debug builds crashed while reading InteractiveActions.xml

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8284 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2016-08-11 13:48:38 +00:00
parent f71e00ed78
commit 2c5e85f828
2 changed files with 20 additions and 16 deletions
+11 -7
View File
@@ -116,14 +116,18 @@ interactiveactionsEndElementHandle( void *userData, const XML_Char *name )
// for whatever reasons the game crashes in VS2008 Release builds when copying over the tilevector
// this seems odd, as this works just fine in VS2010 and VS2013, and also works in VS205 debug builds
// for now, copy over the content by hand
pData->curArray[pData->curIndex].tileindexvector = tileindexvector;
pData->curArray[pData->curIndex].gridnovector = gridnovector;
// check if the vector is empty because assigning an empty vector will crash VS2010 debug builds!
if ( !tileindexvector.empty() )
{
pData->curArray[pData->curIndex].tileindexvector = tileindexvector;
tileindexvector.clear( );
}
tileindexvector.clear( );
tileindexvector.resize( 0 );
gridnovector.clear();
gridnovector.resize( 0 );
if ( !gridnovector.empty() )
{
pData->curArray[pData->curIndex].gridnovector = gridnovector;
gridnovector.clear();
}
}
pData->curIndex++;