Fix FP_LOADER_THREAD resource leak

The mechanism of thread termination was changed in 61c2beea and not done
correctly - the thread was not notified that it should terminate.
This commit is contained in:
Chris Pavlina 2017-03-27 14:23:03 -04:00
parent ffef8b6c56
commit c7c172d368
1 changed files with 11 additions and 2 deletions

View File

@ -123,6 +123,15 @@ class FP_THREAD_IFACE
m_panel = aPanel;
}
/**
* Get the associated panel.
*/
FOOTPRINT_PREVIEW_PANEL* GetPanel()
{
MUTLOCK lock( m_lock );
return m_panel;
}
/**
* Post an event to the panel, if the panel still exists. Return whether
* the event was posted.
@ -217,7 +226,7 @@ public:
virtual void* Entry() override
{
while( !TestDestroy() )
while( m_iface->GetPanel() )
{
auto ent = m_iface->PopFromQueue();
@ -227,7 +236,7 @@ public:
wxMilliSleep( 100 );
}
return NULL;
return nullptr;
}
};