From 0084fb94beab7e45caeb2a069a5b678c686758f1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 Jun 2018 23:09:06 +0200 Subject: [PATCH] Use wxDynamicCast() instead of static_cast<> This is safer as it really checks if the pointer is of the correct type. --- src/osx/cocoa/listbox.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osx/cocoa/listbox.mm b/src/osx/cocoa/listbox.mm index 402de57c04..7e0b32cd7e 100644 --- a/src/osx/cocoa/listbox.mm +++ b/src/osx/cocoa/listbox.mm @@ -298,7 +298,7 @@ protected: int row = [self selectedRow]; wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); - wxListBox *list = static_cast ( impl->GetWXPeer()); + wxListBox* const list = wxDynamicCast(impl->GetWXPeer(), wxListBox); wxCHECK_RET( list != NULL , wxT("Listbox expected")); // Correct notification events for multiselection list, like in Carbon version