Help! wx._core.wxAssertionError: C++ assertion "m_count > 0"

When I run a .py file, I got following message. Does anyone help to give some advices how to solve this problem? thanks a lot!

wx._core.wxAssertionError: C++ assertion “m_count > 0” failed at …\src\common\object.cpp(336) in wxRefCounter::DecRef(): invalid ref data count

The above exception was the direct cause of the following exception:

SystemError: <class ‘wx._core.CommandEvent’> returned a result with an error set

We need to see the Python code you’re trying to run (preferably a minimal reproducer).

Also, what version of wxPython and what platform (Linux, Mac, Windows)?