clear extensions method allows saver reset of MT engine

pull/1/head
Thorsten Liebig 2010-09-02 22:04:35 +02:00
parent 200832b423
commit cabdf4a84a
3 changed files with 12 additions and 5 deletions

View File

@ -73,6 +73,13 @@ void Engine::InitExtensions()
}
}
void Engine::ClearExtensions()
{
for (size_t n=0;n<m_Eng_exts.size();++n)
delete m_Eng_exts.at(n);
m_Eng_exts.clear();
}
void Engine::Reset()
{
Delete_N_3DArray(volt,numLines);
@ -83,9 +90,7 @@ void Engine::Reset()
file_et.close();
file_ht.close();
for (size_t n=0;n<m_Eng_exts.size();++n)
delete m_Eng_exts.at(n);
m_Eng_exts.clear();
ClearExtensions();
}
void Engine::UpdateVoltages(unsigned int startX, unsigned int numX)

View File

@ -80,6 +80,7 @@ protected:
unsigned int numTS;
virtual void InitExtensions();
virtual void ClearExtensions();
vector<Engine_Extension*> m_Eng_exts;
ofstream file_et, file_ht; //excite signal dump file

View File

@ -133,8 +133,9 @@ void Engine_Multithread::Init()
void Engine_Multithread::Reset()
{
if (!m_stopThreads) {
// prevent multiple invocations
if (!m_stopThreads) // prevent multiple invocations
{
ClearExtensions(); //prevent extensions from interfering with thread reset...
// stop the threads
//NS_Engine_Multithread::DBG().cout() << "stopping all threads" << endl;