mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-09 05:20:08 +01:00
Merge pull request #714 from RobinD42/fix-issue688
Don't call CleanUpModules when reinitializing wxModules
This commit is contained in:
@@ -215,6 +215,9 @@ Changes in this release include the following:
|
||||
can be handy in the rare cases where something holds on to a DC for too
|
||||
long, perhaps unintentionally. (#680)
|
||||
|
||||
* Fixed crash due to too aggressive management of wxModules when we load
|
||||
subordinate extensions that have their own wxModules (wx.html, wx.adv, etc.)
|
||||
(#688)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -549,10 +549,22 @@ inline PyObject* i_wxPyMethod_Self(PyObject* method) {
|
||||
|
||||
void i_wxPyReinitializeModules() {
|
||||
if (i_wxPyCheckForApp(false)) {
|
||||
wxModule::CleanUpModules();
|
||||
// NOTE: We are intentionally NOT calling wxModule::CleanUpModules
|
||||
// here because that could clear some things that will not be reset
|
||||
// when used again, leading to crashes. For example, in
|
||||
// wxMSWDCImpl::DoGradientFillLinear it is saving a pointer to an API
|
||||
// function in a dyn-loaded DLL. When modules are cleaned up then that
|
||||
// DLL will be unloaded, leaving a dangling function pointer. We'll
|
||||
// likely end up with multiple instances of some things, but that is
|
||||
// better than the alternaive currently.
|
||||
//wxModule::CleanUpModules();
|
||||
|
||||
wxModule::RegisterModules();
|
||||
wxModule::InitializeModules();
|
||||
wxInitAllImageHandlers();
|
||||
|
||||
// And since we're not calling CleanUpModules there is no longer any
|
||||
// need to re-init the image handlers.
|
||||
//wxInitAllImageHandlers();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user