fix memory crash bug by freeing m_scopeNetworkOperationMode before

EvalBase:Destroy(), since m_scopeNetworkOperationMode requires a reference
to the network.
This commit is contained in:
Zhou Wang 2016-09-28 21:58:48 +02:00
Родитель 9bad39ecc3
Коммит 80040aefd3
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -438,6 +438,8 @@ void CNTKEvalExtended<ElemType>::ForwardPass(const ValueRefs<ElemType>& inputs,
template <typename ElemType>
void CNTKEvalExtended<ElemType>::Destroy()
{
// Since m_scopeNetworkOperationMode has a reference to m_net, it has to be released first.
m_scopedNetworkOperationMode.reset();
CNTKEvalBase<ElemType>::Destroy();
delete this;
}