fix crash in Model::deleteGeometry when _rig is not initialized

This commit is contained in:
Brad Hefta-Gaub 2015-11-12 09:24:49 -08:00
parent b9a0d0b843
commit eefe26d96a

View file

@ -1099,10 +1099,12 @@ void Model::setGeometry(const QSharedPointer<NetworkGeometry>& newGeometry) {
void Model::deleteGeometry() {
_blendedVertexBuffers.clear();
_rig->clearJointStates();
_meshStates.clear();
_rig->deleteAnimations();
_rig->destroyAnimGraph();
if (_rig) {
_rig->clearJointStates();
_rig->deleteAnimations();
_rig->destroyAnimGraph();
}
_blendedBlendshapeCoefficients.clear();
}