aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtDeclarative
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-12-14 16:25:21 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:47:58 -0300
commit8974ff4abd320ad6089919010c08b4461ff8c11e (patch)
tree10ed1a3e3381aa28d2ce4998c652e3330e2a619b /PySide/QtDeclarative
parent39d61bdc0565a5ce9ec301283a4485e43aaa1f62 (diff)
Fix bug#508 - "qmltopy1 crashes when setContextProperty is called twice without keeping a reference"
Reviewer: Renato Araújo <renato.filho@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'PySide/QtDeclarative')
-rw-r--r--PySide/QtDeclarative/typesystem_declarative.xml8
1 files changed, 5 insertions, 3 deletions
diff --git a/PySide/QtDeclarative/typesystem_declarative.xml b/PySide/QtDeclarative/typesystem_declarative.xml
index d1424abff..d4edee8d2 100644
--- a/PySide/QtDeclarative/typesystem_declarative.xml
+++ b/PySide/QtDeclarative/typesystem_declarative.xml
@@ -69,9 +69,11 @@
</object-type>
<object-type name="QDeclarativeContext">
<modify-function signature="setContextProperty(const QString &amp;, QObject*)">
- <modify-argument index="2">
- <reference-count action="add"/>
- </modify-argument>
+ <inject-code class="target" position="end">
+ QByteArray key("%FUNCTION_NAME_");
+ key.append(%1.toLocal8Bit());
+ Shiboken::Object::keepReference(reinterpret_cast&lt;SbkObject*&gt;(%PYSELF), key.constData(), %PYARG_2);
+ </inject-code>
</modify-function>
</object-type>