[glib/floating-ref-warning: 2/2] Please don't use GInitiallyUnowned and floating refs



commit 1368f996d742e444678189a5c6e0a8c523f4b5f0
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sun May 12 17:08:51 2019 +0100

    Please don't use GInitiallyUnowned and floating refs
    
    This place is not a place of honor… No highly esteemed API is implemented
    here… Nothing valued is here.

 gobject/gobject.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 23201f192..ff7c69850 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -53,6 +53,13 @@
  *
  * ## Floating references # {#floating-ref}
  *
+ * **Note**: Floating references are a C convenience API and should not be
+ * used in modern GObject code. Language bindings in particular find the
+ * concept highly problematic, as floating references are not identifiable
+ * through annotations, and neither are deviations from the floating reference
+ * behavior, like types that inherit from GInitiallyUnowned and still return
+ * a full reference from `g_object_new()`.
+ *
  * GInitiallyUnowned is derived from GObject. The only difference between
  * the two is that the initial reference of a GInitiallyUnowned is flagged
  * as a "floating" reference. This means that it is not specifically


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]