AssbinLoader: fix setting mNumChildren and releasing the smart pointer

pull/2242/head
Martin Jeřábek 2018-11-26 15:10:48 +01:00
parent a916c7b1e3
commit 770356a55b
1 changed files with 2 additions and 1 deletions

View File

@ -241,9 +241,9 @@ void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** onode, aiNode*
node->mChildren = new aiNode*[numChildren];
for (unsigned int i = 0; i < numChildren; ++i) {
ReadBinaryNode( stream, &node->mChildren[i], node.get() );
node->mNumChildren++;
}
}
*onode = node.release();
if ( nb_metadata > 0 ) {
node->mMetaData = aiMetadata::Alloc(nb_metadata);
@ -284,6 +284,7 @@ void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** onode, aiNode*
node->mMetaData->mValues[i].mData = data;
}
}
*onode = node.release();
}
// -----------------------------------------------------------------------------------