summaryrefslogtreecommitdiff
path: root/tests/test_signal.py
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2019-07-16 22:08:04 +0200
committerChristoph Reiter <reiter.christoph@gmail.com>2019-08-11 18:13:35 +0000
commita102f046a178472278522e3e9d7c0b40ecd52ade (patch)
tree398c92c4c0a6ed7edc74759b24f5e3a591ce9329 /tests/test_signal.py
parentac576400ecd554879c906791e6638d64bb8bcc2a (diff)
downloadpygobject-a102f046a178472278522e3e9d7c0b40ecd52ade.tar.gz
pygobject-object: fix refcount of floating return values
When g_signal_emitv returns a floating reference as the return value, which we end up ref_sinking, do not unset the GValue, as we've taken ownership from it and don't want it to drop its reference. Adds a test that highlights the issue
Diffstat (limited to 'tests/test_signal.py')
-rw-r--r--tests/test_signal.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_signal.py b/tests/test_signal.py
index 16d95c27..edc970fc 100644
--- a/tests/test_signal.py
+++ b/tests/test_signal.py
@@ -1243,6 +1243,11 @@ class TestIntrospectedSignals(unittest.TestCase):
# Boxed equality checks pointers by default.
self.assertNotEqual(struct, held_struct)
+ def test_action(self):
+ obj = Regress.TestAction()
+ other_obj = obj.emit('action')
+ self.assertEqual(other_obj.__grefcount__, 1)
+
class TestIntrospectedSignalsIssue158(unittest.TestCase):
"""