diff options
author | Renato Filho <renato.filho@openbossa.org> | 2010-02-19 17:10:24 -0300 |
---|---|---|
committer | Renato Filho <renato.filho@openbossa.org> | 2010-02-23 16:35:40 -0300 |
commit | 75b7afbd63be9b27d3bd964891720e8c16079280 (patch) | |
tree | f56e9d83a73bff0119333649521663f5c45aad20 /PySide/QtCore/typesystem_core.xml | |
parent | ab738e07d2cffc0fc9692ecc3a5f830847b853bb (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.xml | 10 |
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) && (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"/> |