summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-09-08 19:32:33 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-09-08 19:39:31 -0300
commit63cacc4411cd52e359e1867532524ee816248b61 (patch)
tree99d52fcf0992c694299d9b9e9347c06b5e34c041
parent6daa2edea54d10e761d0432137373f226f2613ca (diff)
downloadshiboken-63cacc4411cd52e359e1867532524ee816248b61.tar.gz
shiboken-63cacc4411cd52e359e1867532524ee816248b61.tar.xz
shiboken-63cacc4411cd52e359e1867532524ee816248b61.zip
Created module shutdown function necessary to avoid call python functions before module exit.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
-rw-r--r--PySide/CMakeLists.txt6
-rw-r--r--PySide/QtCore/typesystem_core.xml7
-rw-r--r--PySide/__init__.py1
-rw-r--r--PySide/private.py4
4 files changed, 17 insertions, 1 deletions
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index e4b6a1d8..66621bef 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -1,5 +1,5 @@
project(pyside)
-install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py"
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py" "${CMAKE_CURRENT_SOURCE_DIR}/private.py"
DESTINATION "${SITE_PACKAGE}/${BINDING_NAME}")
macro(execute_generator module sources typesystem_path)
@@ -106,6 +106,10 @@ endmacro()
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py"
"${CMAKE_BINARY_DIR}/PySide/__init__.py")
+
+execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/private.py"
+ "${CMAKE_BINARY_DIR}/PySide/private.py")
+#
# Try to find QtMultimedia
# TODO: Remove this hack when cmake support QtMultimedia module
if (NOT QT_QTMULTIMEDIA_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 1e7d1832..8fdb0e5f 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -520,6 +520,7 @@
<include file-name="QTextDocument" location="global"/>
</extra-includes>
</namespace-type>
+
<add-function signature="qAbs(double)" return-type="double">
<inject-code class="target" position="beginning">
%PYARG_0 = %CONVERTTOPYTHON[double](qAbs(%1));
@@ -531,6 +532,12 @@
PyModule_AddStringConstant(module, "QT_VERSION_STR", QT_VERSION_STR);
</inject-code>
+ <add-function signature="__moduleShutdown()">
+ <inject-code class="target" position="beginning">
+ PySide::SignalManager::instance().clear();
+ </inject-code>
+ </add-function>
+
<enum-type name="QtMsgType"/>
<enum-type name="QSystemSemaphore::AccessMode"/>
<enum-type name="QSystemSemaphore::SystemSemaphoreError"/>
diff --git a/PySide/__init__.py b/PySide/__init__.py
index d9db08ea..c93c5df6 100644
--- a/PySide/__init__.py
+++ b/PySide/__init__.py
@@ -1 +1,2 @@
__all__ = ['QtCore', 'QtGui', 'QtNetwork', 'QtOpenGL', 'QtSql', 'QtSvg', 'QtTest', 'QtWebKit', 'QtScript']
+import private
diff --git a/PySide/private.py b/PySide/private.py
new file mode 100644
index 00000000..0fe1c132
--- /dev/null
+++ b/PySide/private.py
@@ -0,0 +1,4 @@
+import atexit
+from QtCore import __moduleShutdown
+
+atexit.register(__moduleShutdown)