aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtCore/typesystem_core.xml
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-02-19 17:10:24 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-02-23 16:35:40 -0300
commit75b7afbd63be9b27d3bd964891720e8c16079280 (patch)
treef56e9d83a73bff0119333649521663f5c45aad20 /PySide/QtCore/typesystem_core.xml
parentab738e07d2cffc0fc9692ecc3a5f830847b853bb (diff)
Fixed memory leak on callbacks used on signal connection.
Now using the 'destroyed()' signal the reference is cleaned after source object destroyed.
Diffstat (limited to 'PySide/QtCore/typesystem_core.xml')
-rw-r--r--PySide/QtCore/typesystem_core.xml10
1 files changed, 10 insertions, 0 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index fdfeb3739..212e19226 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1631,6 +1631,16 @@
</inject-code>
</add-function>
+ <modify-function signature="receivers(const char*) const">
+ <inject-code class="target" position="beginning">
+ //Avoid return +1 because SignalManager connect to "destroyed()" signal to control object timelife
+ int ret = %CPPSELF.%FUNCTION_NAME(%1);
+ if ((strcmp(%1, SIGNAL(destroyed())) == 0) &amp;&amp; (PySide::SignalManager::instance().hasConnectionWith(%CPPSELF)))
+ ret--;
+ %PYARG_0 = %CONVERTTOPYTHON[int](ret);
+ </inject-code>
+ </modify-function>
+
<modify-function signature="sender() const">
<modify-argument index="return">
<define-ownership owner="target"/>