Don't bother resetting wxStaticBitmap image when destroying it

This results in sending a WM_PAINT to the control parent which may be
rather unexpected if it happens while it is itself being destroyed, see
the fix for #25499 in the parent commit, so don't do it when Free() is
called from dtor.

And it is also unnecessary to do it when Free() is called from
DoUpdateImage(), as it calls MSWReplaceImageHandle() with another,
valid, handle right next anyhow.
This commit is contained in:
Vadim Zeitlin
2025-06-12 22:40:28 +02:00
parent ebd7c64685
commit 3e32a9abe1
-2
View File
@@ -161,8 +161,6 @@ void wxStaticBitmap::Free()
{
m_bitmap.UnRef();
MSWReplaceImageHandle(0);
if ( m_ownsCurrentHandle )
{
::DeleteObject(m_currentHandle);