Prevent division by zero in GetProgress()

This commit is contained in:
eap 2013-11-18 15:56:48 +00:00
parent 293fc4dc12
commit 4280b9f4db

View File

@ -436,7 +436,7 @@ double NETGENPlugin_NETGEN_2D_ONLY::GetProgress() const
if ( _progressByTic < 0 ) if ( _progressByTic < 0 )
{ {
NETGENPlugin_NETGEN_2D_ONLY* me = (NETGENPlugin_NETGEN_2D_ONLY*) this; NETGENPlugin_NETGEN_2D_ONLY* me = (NETGENPlugin_NETGEN_2D_ONLY*) this;
me->_progressByTic = 0.25 / _progressTic; me->_progressByTic = 0.25 / (_progressTic+1);
} }
const_cast<NETGENPlugin_NETGEN_2D_ONLY*>( this )->_progressTic++; const_cast<NETGENPlugin_NETGEN_2D_ONLY*>( this )->_progressTic++;
progress = Max( progress, _progressByTic * _progressTic ); progress = Max( progress, _progressByTic * _progressTic );