Files
wxWidgets/include
Vadim Zeitlin 2be5f429c1 Don't create wrong wxAppTraits during wxApp construction
Creating wxAppTraits before the object of the user-defined class
deriving from wxApp is fully constructed may result in creating a wrong
traits object if the user class overrides CreateTraits() because the
correct, i.e. user-defined, version isn't used if it's called from wx
code.

This had already happened before and was worked around back in
bc334f39ec (Fixes Bug [ 930200 ] Async does not work, 2004-04-27), but
recently happened again after the changes of 94e4818caa (Warn on startup
when not using comctl32.dll v6 in wxMSW, 2022-11-28). To prevent it from
happening in the future, add WXAppConstructed() that must be called
after fully constructing wxApp (and forgetting to do it would result in
an assert, so doesn't risk to go unnoticed) and which resets m_traits if
it has been wrongly created.

It would, perhaps, be even better if we avoided creating the wrong
traits in the first place, but for now this at least fixes the latest
problem and ensures it doesn't reoccur.

Closes #23315.
2023-03-06 21:28:58 +00:00
..