mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-03-23 18:54:01 +08:00
Due to a regression introduced in 3e32a9abe1 (Don't bother resetting
wxStaticBitmap image when destroying it, 2025-06-12), which was part
of #25518, the handle of wxBitmap passed to wxStaticBitmap::SetBitmap()
was destroyed when another bitmap was passed to SetBitmap() later.
Fix this by ensuring that we don't overwrite the value of the current
handle (to be deleted) prematurely in DoUpdateImage().
Add a simple unit test for wxStaticBitmap checking that the problem is
really fixed and, under MSW, also that it doesn't leak bitmap handles.
Closes #26106.
Tests
This directory contains tests for the library and is mostly useful for the
library developers. See the samples subdirectory for the examples that are
more useful to the application developers using the library.
If you do work on the library itself and would like to modify an existing or
add a new test, please see docs/contributing/how-to-write-unit-tests.md for
more information.
This file also contains the instructions for running the tests if you'd just like to do it to confirm that the library works correctly.