Skip to content

Commit edfb1f9

Browse files
jcfrmrbean-bremen
authored andcommitted
fix: Ensure proper cleanup in PythonQtTestCleanup
This changes the order of cleanup operations in PythonQtTestCleanup::cleanup(). By calling PythonQt::cleanup() before checking if Python is initialized, we ensure the proper finalization of resources.
1 parent 6a8199c commit edfb1f9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/PythonQtTestCleanup.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@ void PythonQtTestCleanup::init()
2424

2525
void PythonQtTestCleanup::cleanup()
2626
{
27-
// Finalize and cleanup after each test
27+
// Cleanup PythonQt resources before finalizing Python
28+
PythonQt::cleanup();
2829

2930
if (Py_IsInitialized()) {
3031
Py_Finalize();
3132
}
3233

33-
PythonQt::cleanup();
34-
3534
delete _helper;
3635
_helper = nullptr;
3736
}

0 commit comments

Comments
 (0)