glib/gobject
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
..
tests g_binding_unbind: make it more introspection friendly; allow calling it multiple times. Fixes #1373 2018-08-16 11:27:34 +02:00
.gitignore build: Drop nmake/MSC build system for GLib 2017-07-10 11:22:40 +01:00
ChangeLog Update README files to refer to git 2009-03-31 19:39:16 -04:00
gatomicarray.c gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gatomicarray.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gbinding.c g_binding_unbind: make it more introspection friendly; allow calling it multiple times. Fixes #1373 2018-08-16 11:27:34 +02:00
gbinding.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gboxed.c gdate: add g_date_copy() 2017-10-11 12:13:20 +01:00
gboxed.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gclosure.c Fix Windows build errors in valgrind.h 2018-05-28 09:22:55 -04:00
gclosure.h gclosure: Expand documentation and fix some typos 2018-04-26 18:04:47 +01:00
genums.c gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
genums.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
glib-genmarshal.in gobject: Fix redundant warning message in glib-genmarshal 2018-04-23 16:16:36 +01:00
glib-mkenums.in glib-mkenums: improve and correct argument documentation 2018-08-10 17:18:36 +01:00
glib-types.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gmarshal.c introspection: use (nullable) or (optional) instead of (allow-none) 2016-11-22 14:14:37 -08:00
gmarshal.h gmarshal.h: replace "extern" with GLIB_AVAILABLE_IN_ALL 2013-01-13 13:13:55 -05:00
gobject_gdb.py python: avoid equality check for None 2018-07-12 23:48:41 +02:00
gobject_probes.d Add missing semicolons to gobject_probes.d 2012-10-15 19:48:44 -04:00
gobject_trace.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gobject-autocleanups.h gobject: Add g_autoptr() support for GTypeClass, GEnumClass, GFlagsClass 2018-05-15 15:38:33 +01:00
gobject-query.c gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gobject.c docs: Fix a documentation link 2018-07-30 21:15:57 +01:00
gobject.h gmacros: Add new private g_has_typeof to abstract __typeof__ checks 2018-07-16 15:59:44 +01:00
gobject.rc.in meson: build Windows resource files 2018-01-04 22:19:30 +01:00
gobject.stp.in glib: Namespace global tapset variables by soname 2016-11-23 10:50:39 +00:00
gobjectnotifyqueue.c gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gparam.c gobject: Fix typo in documentation for g_param_spec_get_default_value() 2017-11-01 11:13:27 +00:00
gparam.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gparamspecs.c gobject: Reimplement g_param_values_cmp() for GParamSpecVariant 2018-05-04 18:17:59 +01:00
gparamspecs.h gobject: Reimplement g_param_values_cmp() for GParamSpecVariant 2018-05-04 18:17:59 +01:00
gsignal.c docs: Fix typo in gsignal.c documentation comment 2018-05-17 13:54:46 +01:00
gsignal.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gsourceclosure.c all: Remove trailing newlines from g_message()/g_warning()/g_error()s 2018-04-27 16:46:19 +01:00
gsourceclosure.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gtype-private.h gtype: Add private DEFINE_TYPE with prelude to workaround gtype deadlocks 2017-06-14 14:45:45 -04:00
gtype.c Deprecate g_type_class_add_private() 2018-06-14 11:33:53 +01:00
gtype.h Deprecate g_type_class_add_private() 2018-06-14 11:33:53 +01:00
gtypemodule.c all: Remove trailing newlines from g_message()/g_warning()/g_error()s 2018-04-27 16:46:19 +01:00
gtypemodule.h docs: Remove XML-style comments from documentation strings 2018-01-12 15:29:29 +00:00
gtypeplugin.c gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gtypeplugin.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gvalue.c gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gvalue.h Revert "GValue – Don't cast G_VALUE_TYPE() argument to GValue*" 2018-02-08 14:28:32 +00:00
gvaluearray.c build: Remove the --disable-mem-pools build option and the DISABLE_MEM_POOLS macro 2018-06-02 09:45:55 +02:00
gvaluearray.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gvaluecollector.h gobject: Add prefixes to variables in G_VALUE_COLLECT*() macros 2018-06-20 16:00:48 +01:00
gvaluetransform.c gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gvaluetypes.c gobject: Add missing annotations to GValue variant methods 2017-11-28 14:29:36 +00:00
gvaluetypes.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
libgobject-gdb.py.in Rename gdb macros with _gdb suffix to avoid ns clashes 2016-05-23 10:52:10 -04:00
Makefile.am build: Drop Visual Studio projects 2018-06-06 23:54:13 +08:00
meson.build Merge branch 'meson-python-module' into 'master' 2018-07-23 11:17:47 +00:00