From 669d302ccfbeb79feca8bdcf1596714b5462893c Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Tue, 24 Jan 2023 06:54:10 -0500 Subject: [PATCH] Revert "Try to handle fetching the player frame slightly safely" This reverts commit 679a3a6552d7666a12eeb6b065fe542cb63b26c7. --- common/kiway.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/common/kiway.cpp b/common/kiway.cpp index 500a71e807..92760f68b9 100644 --- a/common/kiway.cpp +++ b/common/kiway.cpp @@ -382,15 +382,12 @@ KIWAY_PLAYER* KIWAY::GetPlayerFrame( FRAME_T aFrameType ) wxWindow* frame = wxWindow::FindWindowById( storedId ); - // sanity check to ensure we didn't somehow get a bad window - KIWAY_PLAYER* player = dynamic_cast( frame ); - // 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 - if( !frame || !player ) + if( !frame ) m_playerFrameId[aFrameType].compare_exchange_strong( storedId, wxID_NONE ); - return player; + return static_cast( frame ); }