glib/gobject/tests
Christoph Reiter 0319dac01d g_binding_unbind: make it more introspection friendly; allow calling it multiple times. Fixes #1373
g_object_bind_property() (transfer none) returns a GBinding with an existing internal
reference which is active as long as the "binding" is. This allows to optionally use
the binding without any memory management, as it will remove itself when it is no longer
needed.

There are currently three ways to remove the "binding" and as a result the reference:

1) Either the source or target dies and we get notified by a weakref callback
2) The user unrefs the binding until it is destroyed (which is semi-legal,
   but worked and is used in the test suite)
3) The user calls g_binding_unbind()

In case (3) the problem was that it always calls unref even if the "binding" is already
gone, leading to crashes when called from bindings multiple times.
In #1373 and !197 it was noticed that a function always unrefs which would be a
"transfer full" annotation, but the problem here is that it should only remove the
ref when removing the "binding" and the annotation should stay "transfer none".

As a side effect of this fix it is now also possible to call g_binding_unbind() multiple
times where every call after the first is a no-op.

This also adds explicit tests for case (1) and (3) - only case (3) is affected by this change.
2018-08-16 11:27:34 +02:00
..
.gitignore .gitignore updates 2015-10-23 11:28:03 -04:00
binding.c g_binding_unbind: make it more introspection friendly; allow calling it multiple times. Fixes #1373 2018-08-16 11:27:34 +02:00
boxed.c boxed: Fix double free in boxed unit tests 2013-11-11 07:20:09 +01:00
closure.c Fix the closure test in continuous 2014-05-30 10:22:35 -04:00
dynamictests.c Drop trailing semi-colon from G_DEFINE_ macro 2017-04-10 10:38:31 +01:00
enums.c gobject: Add to_string() functions for Enum and Flags types 2017-03-30 09:52:28 +01:00
ifaceproperties.c gobject/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
Makefile.am Re-enable signal tests when cross-compiling 2017-07-10 16:47:48 +01:00
marshalers.list Add more tests for signal emissions 2012-03-02 17:13:04 +01:00
meson.build meson: use the new 'python' module instead of the 'python3' one. Closes #1455 2018-07-19 12:32:29 +02:00
mkenums.py glib-mkenums: don't support @filename@/@basename@ in fhead/ftail 2018-08-10 17:05:59 +01:00
object.c gobject: re-allow finalization from constructor() 2014-02-15 10:20:53 -05:00
param.c Drop trailing semi-colon from G_DEFINE_ macro 2017-04-10 10:38:31 +01:00
private.c Deprecate g_type_class_add_private() 2018-06-14 11:33:53 +01:00
properties.c tests: Various minor leak fixes in the GObject tests 2018-06-29 12:13:32 +01:00
qdata.c gobject/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
reference.c gobject: Make g_clear_object take a non-volatile GObject ** 2018-07-12 08:47:40 +01:00
signal-handler.c Add a performance test for signal connection 2015-05-27 14:41:19 -04:00
signals.c Fix the signals test 2016-08-27 22:54:39 -04:00
taptestrunner.py tests: Add initial test framework for glib-mkenums 2018-06-25 13:39:13 +01:00
testcommon.h gobject/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
threadtests.c g_usleep: round up the next millisecond on Windows. See #1371 2018-05-27 09:23:25 +02:00
type.c Improve test coverage in gobject/ 2013-05-29 08:37:08 -04:00
value.c Allow passing unset GValues to g_value_unset() 2015-10-02 10:07:53 -04:00