My project wraps Python and wxPython for AutoCAD.
I use wxPython’s DLLs, so I guess that's version 3.2 ish
initWxApp and initWxApp functions are called when my DLL is loaded/unloaded in AutoCAD
https://github.com/CEXT-Dan/PyRx/blob/7c17f633defc7fa339abf064592fa85044e91310/PyRxCore/PyRxApp.cpp#L155-L199
if I add this to initWxApp
wxXmlInitResourceModule()
wxXmlResource::Get()->InitAllHandlers();then something is trying to call wxApp::MSWProcessPendingEventsIfNeeded after wxEntryCleanup() is called, wxTheApp is null, my .DLL is already unloaded I get an exception in the host application
Exception thrown at 0x00007FFB6AB4AC31 (wxmsw32u_core_vc140_x64.dll) in gcad.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
Note, in the real world I don’t explicitly call wxXmlInitResourceModule, this is what’s called in wxPython. But I can reproduce the issue excluding python. If it's not loaded, there's no issue
My workaround is not satisfactory, it there something leaking in wxXmlResource?
wxPython does not have .pdb files, so I can’t debug.
Any ideas?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
wxXmlInitResourceModule() shouldn't be called, it's some remnant of 25 year old code which probably shouldn't even exist.
I don't know why wxPython uses it, but the only fix at wx side is probably to make this function do nothing. It would be even better to remove it completely, of course, but if wxPython uses it, it would break its build.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
wxXmlInitResourceModule()shouldn't be called, it's some remnant of 25 year old code which probably shouldn't even exist.I don't know why wxPython uses it, but the only fix at wx side is probably to make this function do nothing. It would be even better to remove it completely, of course, but if wxPython uses it, it would break its build.
It seems wxPython calls it in
from wx import xrc
https://github.com/wxWidgets/Phoenix/blob/09516ed4f0b36236547683d4bc1cf4387562657e/etg/_xrc.py#L63-L66
It seems something somewhere is calling wxTheApp without a null check
IMHO, it should be removed for 3.3 (3.4) to force this fix. As far as I can tell wxPython has not switched to 3.3 yet
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
The call to this function was uncommented in wxWidgets/Phoenix@d9a64ce by Robin, so apparently it was supposed to help with module reinitialization, but I don't see how.
I'm in favour of deprecating this function and making it do nothing in 3.3.2.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()