From cd052f46192180cc1dc26de8b91ea1082154c000 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Mon, 30 May 2011 18:56:27 +0000 Subject: [PATCH] Clean up PythonQtSignalReceivers properly, fixing a segfault on exit of the python test --- .../patches/cleanup-signal-receivers.patch | 20 +++++++++++++++++++ 3rdparty/pythonqt/src/PythonQt.cpp | 9 +++------ 2 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 3rdparty/pythonqt/patches/cleanup-signal-receivers.patch diff --git a/3rdparty/pythonqt/patches/cleanup-signal-receivers.patch b/3rdparty/pythonqt/patches/cleanup-signal-receivers.patch new file mode 100644 index 000000000..0f50f3086 --- /dev/null +++ b/3rdparty/pythonqt/patches/cleanup-signal-receivers.patch @@ -0,0 +1,20 @@ +diff --git a/3rdparty/pythonqt/src/PythonQt.cpp b/3rdparty/pythonqt/src/PythonQt.cpp +index f97bdf1..dfde7a0 100644 +--- a/3rdparty/pythonqt/src/PythonQt.cpp ++++ b/3rdparty/pythonqt/src/PythonQt.cpp +@@ -200,12 +200,9 @@ PythonQtPrivate::~PythonQtPrivate() { + delete _defaultImporter; + _defaultImporter = NULL; + +- { +- QHashIterator i(_knownClassInfos); +- while (i.hasNext()) { +- delete i.next().value(); +- } +- } ++ qDeleteAll(_knownClassInfos.values()); ++ qDeleteAll(_signalReceivers.values()); ++ + PythonQtConv::global_valueStorage.clear(); + PythonQtConv::global_ptrStorage.clear(); + PythonQtConv::global_variantStorage.clear(); diff --git a/3rdparty/pythonqt/src/PythonQt.cpp b/3rdparty/pythonqt/src/PythonQt.cpp index f97bdf1b1..dfde7a028 100644 --- a/3rdparty/pythonqt/src/PythonQt.cpp +++ b/3rdparty/pythonqt/src/PythonQt.cpp @@ -200,12 +200,9 @@ PythonQtPrivate::~PythonQtPrivate() { delete _defaultImporter; _defaultImporter = NULL; - { - QHashIterator i(_knownClassInfos); - while (i.hasNext()) { - delete i.next().value(); - } - } + qDeleteAll(_knownClassInfos.values()); + qDeleteAll(_signalReceivers.values()); + PythonQtConv::global_valueStorage.clear(); PythonQtConv::global_ptrStorage.clear(); PythonQtConv::global_variantStorage.clear();