Revert "Try to handle fetching the player frame slightly safely"

This reverts commit 679a3a6552.
This commit is contained in:
Marek Roszko 2023-01-24 06:54:10 -05:00
parent 00e2bbac5a
commit 669d302ccf
1 changed files with 2 additions and 5 deletions

View File

@ -382,15 +382,12 @@ KIWAY_PLAYER* KIWAY::GetPlayerFrame( FRAME_T aFrameType )
wxWindow* frame = wxWindow::FindWindowById( storedId ); wxWindow* frame = wxWindow::FindWindowById( storedId );
// sanity check to ensure we didn't somehow get a bad window
KIWAY_PLAYER* player = dynamic_cast<KIWAY_PLAYER*>( frame );
// Since wxWindow::FindWindow*() is not cheap (especially if the window does not exist), // Since wxWindow::FindWindow*() is not cheap (especially if the window does not exist),
// clear invalid entries to save CPU on repeated calls that do not lead to frame creation // clear invalid entries to save CPU on repeated calls that do not lead to frame creation
if( !frame || !player ) if( !frame )
m_playerFrameId[aFrameType].compare_exchange_strong( storedId, wxID_NONE ); m_playerFrameId[aFrameType].compare_exchange_strong( storedId, wxID_NONE );
return player; return static_cast<KIWAY_PLAYER*>( frame );
} }