-
Notifications
You must be signed in to change notification settings - Fork 84
Update patched-6 branch #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit prevents crashes by handling scenarios such as: (a) object destruction after the Python interpreter has been finalized (b) object destruction after cleanup, i.e. the singleton no longer exists Any usage of a Qt enum demonstrates (a). One example that demonstrates (b) is a QTimer object which is created with a QApplication parent. PythonQt::cleanup() is called before the QApplication is completely destroyed, so the code that handles wrapping the QTimer object must handle the case when the PythonQt singleton no longer exists. Co-authored-by: Jean-Christophe Fillion-Robin <[email protected]>
This commit fixes a link error building PythonQtCppTests on Windows: 1>PythonQtCppTests.obj : error LNK2001: unresolved external symbol "int __cdecl tests_PythonQtTestMain(int,char * * const)" (?tests_PythonQtTestMain@@YAHHQEAPEAD@Z) 1>C:\temp\PythonQt-build\Debug\PythonQtCppTests.exe : fatal error LNK1120: 1 unresolved externals
A sequence of calls like the following would crash in Python when reinitializing the interpreter the second time: PythonQt::init(0); ... Py_Finalize(); PythonQt::init(0); ... Py_Finalize();
This commit changes initialization of the global storage containers to be explicit instead of happening during static initialization. This makes the containers properly initialized if PythonQt is initialized and cleaned up more than once. The motivation for this change is to support testing cleanup and finalization.
Add tests that check for clean cleanup and finalization in different scenarios. Co-authored-by: Jean-Christophe Fillion-Robin <[email protected]> Co-authored-by: Pat Marion <[email protected]>
This commit fixes a crash during PythonQt::cleanup(). While destroying the PythonQtPrivate instance, any remaining PythonQtSignalReceivers that are kept alive only by their parent object will be destroyed. The crash occurs when PythonQtSignalReceiver's destructor calls back into PythonQtPrivate::removeSignalEmitter() when the PythonQtPrivate instance is mostly destroyed. Includes test case that crashes without the fix.
This commit fixes the following link error: PythonQtTestMain.cpp:(.text+0x1637): undefined reference to `PythonQtTestCleanup::~PythonQtTestCleanup()'
This will allow to easily add new exceptions when adding support for Qt5..
Based on work from the following individual: * Melven Röhrig-Zöllner (https://sourceforge.net/p/pythonqt/discussion/631392/thread/5f20c176/) * Julien Finet (@finetjul): See commontk#38) * Arnaud Barre (@Alzathar):See commontk#15 * Eric Heim (@eric-h):See commontk#36
Thanks Matt. I will have a look tmrw and integrate. In the mean time, I wonder if it would make sense to do a svn rebase Jc
|
Thanks again for the PR 👍 Integrated in 56550e4 |
This is a rebase of the more recent patched-5 commits onto the patched-6 branch (which has a linear svn history, rather than svn commits interspersed with git commits as on patched-5), plus an additional patch to fix a link error.
A fast-forward merge may be preferable...