glib2 3.2.4-x86-mingw32 → 3.2.5-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/ext/glib2/glib2.def +3 -0
  3. data/ext/glib2/rbglib.h +5 -1
  4. data/ext/glib2/rbgobj_binding.c +9 -1
  5. data/ext/glib2/rbgobj_closure.c +9 -9
  6. data/ext/glib2/rbgobj_object.c +82 -14
  7. data/ext/glib2/rbgobject.c +51 -22
  8. data/ext/glib2/rbgobject.h +8 -0
  9. data/ext/glib2/rbgprivate.h +2 -1
  10. data/lib/2.2/glib2.so +0 -0
  11. data/lib/2.3/glib2.so +0 -0
  12. data/lib/2.4/glib2.so +0 -0
  13. data/lib/2.5/glib2.so +0 -0
  14. data/vendor/local/bin/asn1Coding.exe +0 -0
  15. data/vendor/local/bin/asn1Decoding.exe +0 -0
  16. data/vendor/local/bin/asn1Parser.exe +0 -0
  17. data/vendor/local/bin/envsubst.exe +0 -0
  18. data/vendor/local/bin/gdbus.exe +0 -0
  19. data/vendor/local/bin/gettext.exe +0 -0
  20. data/vendor/local/bin/gio-querymodules.exe +0 -0
  21. data/vendor/local/bin/gio.exe +0 -0
  22. data/vendor/local/bin/glib-compile-resources.exe +0 -0
  23. data/vendor/local/bin/glib-compile-schemas.exe +0 -0
  24. data/vendor/local/bin/gobject-query.exe +0 -0
  25. data/vendor/local/bin/gresource.exe +0 -0
  26. data/vendor/local/bin/gsettings.exe +0 -0
  27. data/vendor/local/bin/gspawn-win32-helper-console.exe +0 -0
  28. data/vendor/local/bin/gspawn-win32-helper.exe +0 -0
  29. data/vendor/local/bin/iconv.exe +0 -0
  30. data/vendor/local/bin/idn2.exe +0 -0
  31. data/vendor/local/bin/libasprintf-0.dll +0 -0
  32. data/vendor/local/bin/libcharset-1.dll +0 -0
  33. data/vendor/local/bin/libffi-6.dll +0 -0
  34. data/vendor/local/bin/libgio-2.0-0.dll +0 -0
  35. data/vendor/local/bin/libglib-2.0-0.dll +0 -0
  36. data/vendor/local/bin/libgmodule-2.0-0.dll +0 -0
  37. data/vendor/local/bin/libgmp-10.dll +0 -0
  38. data/vendor/local/bin/libgnutls-30.dll +0 -0
  39. data/vendor/local/bin/libgobject-2.0-0.dll +0 -0
  40. data/vendor/local/bin/libgthread-2.0-0.dll +0 -0
  41. data/vendor/local/bin/libhogweed-4-2.dll +0 -0
  42. data/vendor/local/bin/libiconv-2.dll +0 -0
  43. data/vendor/local/bin/libidn2-0.dll +0 -0
  44. data/vendor/local/bin/libintl-8.dll +0 -0
  45. data/vendor/local/bin/libnettle-6-2.dll +0 -0
  46. data/vendor/local/bin/libp11-kit-0.dll +0 -0
  47. data/vendor/local/bin/libpcre-1.dll +0 -0
  48. data/vendor/local/bin/libpcrecpp-0.dll +0 -0
  49. data/vendor/local/bin/libpcreposix-0.dll +0 -0
  50. data/vendor/local/bin/libtasn1-6.dll +0 -0
  51. data/vendor/local/bin/nettle-hash.exe +0 -0
  52. data/vendor/local/bin/nettle-lfib-stream.exe +0 -0
  53. data/vendor/local/bin/nettle-pbkdf2.exe +0 -0
  54. data/vendor/local/bin/ngettext.exe +0 -0
  55. data/vendor/local/bin/p11-kit.exe +0 -0
  56. data/vendor/local/bin/pcregrep.exe +0 -0
  57. data/vendor/local/bin/pcretest.exe +0 -0
  58. data/vendor/local/bin/pkcs1-conv.exe +0 -0
  59. data/vendor/local/bin/sexp-conv.exe +0 -0
  60. data/vendor/local/bin/trust.exe +0 -0
  61. data/vendor/local/lib/gio/modules/libgiognutls.dll +0 -0
  62. data/vendor/local/lib/libasprintf.dll.a +0 -0
  63. data/vendor/local/lib/libcharset.dll.a +0 -0
  64. data/vendor/local/lib/libffi.dll.a +0 -0
  65. data/vendor/local/lib/libgio-2.0.dll.a +0 -0
  66. data/vendor/local/lib/libglib-2.0.dll.a +0 -0
  67. data/vendor/local/lib/libgmodule-2.0.dll.a +0 -0
  68. data/vendor/local/lib/libgmp.dll.a +0 -0
  69. data/vendor/local/lib/libgnutls.dll.a +0 -0
  70. data/vendor/local/lib/libgobject-2.0.dll.a +0 -0
  71. data/vendor/local/lib/libgthread-2.0.dll.a +0 -0
  72. data/vendor/local/lib/libhogweed.dll.a +0 -0
  73. data/vendor/local/lib/libiconv.dll.a +0 -0
  74. data/vendor/local/lib/libidn2.dll.a +0 -0
  75. data/vendor/local/lib/libintl.dll.a +0 -0
  76. data/vendor/local/lib/libnettle.dll.a +0 -0
  77. data/vendor/local/lib/libp11-kit.dll.a +0 -0
  78. data/vendor/local/lib/libpcre.dll.a +0 -0
  79. data/vendor/local/lib/libpcrecpp.dll.a +0 -0
  80. data/vendor/local/lib/libpcreposix.dll.a +0 -0
  81. data/vendor/local/lib/libtasn1.dll.a +0 -0
  82. data/vendor/local/lib/pkcs11/p11-kit-trust.dll +0 -0
  83. data/vendor/local/lib/pkcs11/p11-kit-trust.dll.a +0 -0
  84. data/vendor/local/libexec/p11-kit/p11-kit-remote.exe +0 -0
  85. data/vendor/local/share/glib-2.0/codegen/__init__.pyc +0 -0
  86. data/vendor/local/share/glib-2.0/codegen/__init__.pyo +0 -0
  87. data/vendor/local/share/glib-2.0/codegen/codegen.pyc +0 -0
  88. data/vendor/local/share/glib-2.0/codegen/codegen.pyo +0 -0
  89. data/vendor/local/share/glib-2.0/codegen/codegen_docbook.pyc +0 -0
  90. data/vendor/local/share/glib-2.0/codegen/codegen_docbook.pyo +0 -0
  91. data/vendor/local/share/glib-2.0/codegen/codegen_main.pyc +0 -0
  92. data/vendor/local/share/glib-2.0/codegen/codegen_main.pyo +0 -0
  93. data/vendor/local/share/glib-2.0/codegen/config.pyc +0 -0
  94. data/vendor/local/share/glib-2.0/codegen/config.pyo +0 -0
  95. data/vendor/local/share/glib-2.0/codegen/dbustypes.pyc +0 -0
  96. data/vendor/local/share/glib-2.0/codegen/dbustypes.pyo +0 -0
  97. data/vendor/local/share/glib-2.0/codegen/parser.pyc +0 -0
  98. data/vendor/local/share/glib-2.0/codegen/parser.pyo +0 -0
  99. data/vendor/local/share/glib-2.0/codegen/utils.pyc +0 -0
  100. data/vendor/local/share/glib-2.0/codegen/utils.pyo +0 -0
  101. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '066569384fdfc720ae40835b999288ac76701f7a04ee2633a1f99399307d928c'
4
- data.tar.gz: af6acdda47c77facf6ec9391f4ea6317751b5895ea09ccb28323a4f4bfd4abcd
3
+ metadata.gz: 1dc9fb75536659300b6b63e769c353fde8c4f7ee887abdb420d6b8dbae1d0b07
4
+ data.tar.gz: e9d806e1fcfdf29c1f60011646ffc21a5e9a2c69178b105bbc571ee52e222593
5
5
  SHA512:
6
- metadata.gz: cf917657e77999220efa877be98e006382e5549e1fc19347439571f25f80d472d9e162065d227e742f48db8ebe2fb2f67e45aac0e63082405db384417f9e9083
7
- data.tar.gz: ef43846b17d99f2849c3388f904c9537bd965f78c8575df84b919f8ef1eb3f7fe73b891f78d8610a4b01bb5db5089153d61b0d66b1ed55fb698d9b7a30789bee
6
+ metadata.gz: e2d5b79b3a6bd1f829f25b201d594e24b95d936f2d554d983b9ef389cf408b9daff8039fbbce4b533b64980decc892b751a2087dcf6b820b26b477e9144589a7
7
+ data.tar.gz: 9889dbed514d1881d872a75bbd838b62832de287fbad52ec7798410d2d950d3aa29b2226ce40288703a6a67462db887bc58dc0f6b7db1652515d7d8ac1563dfa
data/ext/glib2/glib2.def CHANGED
@@ -61,6 +61,9 @@ EXPORTS
61
61
  rbgobj_class_init_func
62
62
  rbgobj_register_type
63
63
  rbgobj_object_alloc_func
64
+ rbgobj_object_add_relative
65
+ rbgobj_object_remove_relative
66
+ rbgobj_object_remove_relatives
64
67
  rbgobj_set_signal_func
65
68
  rbgobj_get_signal_func
66
69
  rbgobj_set_signal_call_func
data/ext/glib2/rbglib.h CHANGED
@@ -36,7 +36,7 @@ extern "C" {
36
36
 
37
37
  #define RBGLIB_MAJOR_VERSION 3
38
38
  #define RBGLIB_MINOR_VERSION 2
39
- #define RBGLIB_MICRO_VERSION 4
39
+ #define RBGLIB_MICRO_VERSION 5
40
40
 
41
41
  #ifndef RB_ZALLOC
42
42
  # ifdef ZALLOC
@@ -46,6 +46,10 @@ extern "C" {
46
46
  # endif
47
47
  #endif
48
48
 
49
+ #ifndef RB_ALLOC
50
+ # define RB_ALLOC(type) ALLOC(type)
51
+ #endif
52
+
49
53
  #ifndef RB_ALLOC_N
50
54
  # define RB_ALLOC_N(type, n) ALLOC_N(type, n)
51
55
  #endif
@@ -28,7 +28,15 @@
28
28
  static VALUE
29
29
  rg_unbind(VALUE self)
30
30
  {
31
- g_binding_unbind(_SELF(self));
31
+ GBinding *binding = _SELF(self);
32
+ GObject *source;
33
+ VALUE rb_source;
34
+
35
+ source = g_binding_get_source(binding);
36
+ rb_source = GOBJ2RVAL(source);
37
+ rbgobj_object_remove_relative(rb_source, self);
38
+ g_binding_unbind(binding);
39
+
32
40
  return self;
33
41
  }
34
42
  #endif
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011-2016 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2018 Ruby-GNOME2 Project Team
4
4
  * Copyright (C) 2002-2006 Ruby-GNOME2 Project
5
5
  * Copyright (C) 2002,2003 Masahiro Sakai
6
6
  *
@@ -191,8 +191,9 @@ rclosure_invalidate(G_GNUC_UNUSED gpointer data, GClosure *closure)
191
191
  for (next = rclosure->objects; next; next = next->next) {
192
192
  GObject *object = G_OBJECT(next->data);
193
193
  VALUE obj = rbgobj_ruby_object_from_instance2(object, FALSE);
194
- if (!NIL_P(rclosure->rb_holder) && !NIL_P(obj))
195
- G_REMOVE_RELATIVE(obj, id_closures, rclosure->rb_holder);
194
+ if (!NIL_P(rclosure->rb_holder) && !NIL_P(obj)) {
195
+ rbgobj_object_remove_relative(obj, rclosure->rb_holder);
196
+ }
196
197
  }
197
198
 
198
199
  rclosure_unref(rclosure);
@@ -286,16 +287,15 @@ rclosure_weak_notify(gpointer data, GObject* where_the_object_was)
286
287
  void
287
288
  g_rclosure_attach(GClosure *closure, VALUE object)
288
289
  {
289
- static VALUE mGLibObject = (VALUE)NULL;
290
+ static VALUE cGLibObject = Qnil;
290
291
  GRClosure *rclosure = (GRClosure *)closure;
291
292
 
292
- G_RELATIVE2(object, Qnil, id_closures, rclosure->rb_holder);
293
-
294
- if (!mGLibObject) {
295
- mGLibObject = rb_const_get(mGLib, rb_intern("Object"));
293
+ if (NIL_P(cGLibObject)) {
294
+ cGLibObject = rb_const_get(mGLib, rb_intern("Object"));
296
295
  }
297
- if (rb_obj_is_kind_of(object, mGLibObject)) {
296
+ if (rb_obj_is_kind_of(object, cGLibObject)) {
298
297
  GObject *gobject;
298
+ rbgobj_object_add_relative(object, rclosure->rb_holder);
299
299
  gobject = RVAL2GOBJ(object);
300
300
  rclosure->count++;
301
301
  g_object_weak_ref(gobject, rclosure_weak_notify, rclosure);
@@ -43,19 +43,33 @@ weak_notify(gpointer data, G_GNUC_UNUSED GObject *where_the_object_was)
43
43
  gobj_holder *holder = data;
44
44
 
45
45
  rbgobj_instance_call_cinfo_free(holder->gobj);
46
- rbgobj_invalidate_relatives(holder->self);
46
+ g_hash_table_unref(holder->rb_relatives);
47
+ holder->rb_relatives = NULL;
47
48
  holder->destroyed = TRUE;
48
49
 
49
50
  g_object_unref(holder->gobj);
50
51
  holder->gobj = NULL;
51
52
  }
52
53
 
54
+ static void
55
+ holder_relatives_mark(gpointer key, gpointer value, gpointer user_data)
56
+ {
57
+ VALUE rb_relative = (VALUE)value;
58
+ rb_gc_mark(rb_relative);
59
+ }
60
+
53
61
  static void
54
62
  holder_mark(void *data)
55
63
  {
56
64
  gobj_holder *holder = data;
57
- if (holder->gobj && !holder->destroyed)
58
- rbgobj_instance_call_cinfo_mark(holder->gobj);
65
+
66
+ if (!holder->gobj)
67
+ return;
68
+ if (holder->destroyed)
69
+ return;
70
+
71
+ rbgobj_instance_call_cinfo_mark(holder->gobj);
72
+ g_hash_table_foreach(holder->rb_relatives, holder_relatives_mark, NULL);
59
73
  }
60
74
 
61
75
  static void
@@ -91,6 +105,59 @@ static const rb_data_type_t rg_glib_object_type = {
91
105
  RUBY_TYPED_FREE_IMMEDIATELY,
92
106
  };
93
107
 
108
+ void
109
+ rbgobj_object_add_relative(VALUE rb_gobject, VALUE rb_relative)
110
+ {
111
+ gobj_holder *holder;
112
+ TypedData_Get_Struct(rb_gobject,
113
+ gobj_holder,
114
+ &rg_glib_object_type,
115
+ holder);
116
+ if (holder->rb_relatives) {
117
+ g_hash_table_insert(holder->rb_relatives,
118
+ (gpointer)(rb_relative),
119
+ (gpointer)(rb_relative));
120
+ }
121
+ }
122
+
123
+ void
124
+ rbgobj_object_remove_relative(VALUE rb_gobject, VALUE rb_relative)
125
+ {
126
+ gobj_holder *holder;
127
+ TypedData_Get_Struct(rb_gobject,
128
+ gobj_holder,
129
+ &rg_glib_object_type,
130
+ holder);
131
+ if (holder->rb_relatives) {
132
+ g_hash_table_remove(holder->rb_relatives,
133
+ (gpointer)(rb_relative));
134
+ }
135
+ }
136
+
137
+ static gboolean
138
+ rbgobj_object_remove_relatives_body(gpointer key,
139
+ gpointer value,
140
+ gpointer user_data)
141
+ {
142
+ VALUE rb_relative = (VALUE)value;
143
+ VALUE rb_relative_class = (VALUE)user_data;
144
+
145
+ return RVAL2CBOOL(rb_obj_is_kind_of(rb_relative, rb_relative_class));
146
+ }
147
+
148
+ void
149
+ rbgobj_object_remove_relatives(VALUE rb_gobject, VALUE rb_relative_class)
150
+ {
151
+ gobj_holder *holder;
152
+ TypedData_Get_Struct(rb_gobject,
153
+ gobj_holder,
154
+ &rg_glib_object_type,
155
+ holder);
156
+ g_hash_table_foreach_remove(holder->rb_relatives,
157
+ rbgobj_object_remove_relatives_body,
158
+ (gpointer)(rb_relative_class));
159
+ }
160
+
94
161
  VALUE
95
162
  rbgobj_object_alloc_func(VALUE klass)
96
163
  {
@@ -105,6 +172,7 @@ rbgobj_object_alloc_func(VALUE klass)
105
172
  holder->gobj = NULL;
106
173
  holder->cinfo = NULL;
107
174
  holder->destroyed = FALSE;
175
+ holder->rb_relatives = g_hash_table_new(g_direct_hash, g_direct_equal);
108
176
 
109
177
  return result;
110
178
  }
@@ -686,13 +754,6 @@ static void
686
754
  rg_destroy_bind_property_full_data(gpointer user_data)
687
755
  {
688
756
  RGBindPropertyCallbackData *data = (RGBindPropertyCallbackData *)user_data;
689
-
690
- if (!NIL_P(data->transform_to_callback))
691
- G_CHILD_REMOVE(data->self, data->transform_to_callback);
692
-
693
- if (!NIL_P(data->transform_from_callback))
694
- G_CHILD_REMOVE(data->self, data->transform_from_callback);
695
-
696
757
  xfree(data);
697
758
  }
698
759
 
@@ -715,6 +776,7 @@ rg_bind_property(gint argc, VALUE *argv, VALUE self)
715
776
  GBinding *binding;
716
777
  GBindingTransformFunc transform_to = NULL;
717
778
  GBindingTransformFunc transform_from = NULL;
779
+ VALUE rb_binding;
718
780
 
719
781
  rb_scan_args(argc, argv, "41", &rb_source_property, &rb_target,
720
782
  &rb_target_property, &rb_flags, &rb_options);
@@ -731,18 +793,16 @@ rg_bind_property(gint argc, VALUE *argv, VALUE self)
731
793
  flags = RVAL2GBINDINGFLAGS(rb_flags);
732
794
 
733
795
  if (!NIL_P(rb_transform_to)) {
734
- G_CHILD_ADD(self, rb_transform_to);
735
796
  transform_to = rg_bind_property_transform_to_callback;
736
797
  }
737
798
 
738
799
  if (!NIL_P(rb_transform_from)) {
739
- G_CHILD_ADD(self, rb_transform_from);
740
800
  transform_from = rg_bind_property_transform_from_callback;
741
801
  }
742
802
 
743
803
  if (transform_to || transform_from) {
744
804
  RGBindPropertyCallbackData *data;
745
- data = (RGBindPropertyCallbackData *)xmalloc(sizeof(RGBindPropertyCallbackData));
805
+ data = RB_ALLOC(RGBindPropertyCallbackData);
746
806
  data->self = self;
747
807
  data->transform_to_callback = rb_transform_to;
748
808
  data->transform_from_callback = rb_transform_from;
@@ -752,13 +812,21 @@ rg_bind_property(gint argc, VALUE *argv, VALUE self)
752
812
  transform_from,
753
813
  (gpointer)data,
754
814
  rg_destroy_bind_property_full_data);
815
+ rb_binding = GOBJ2RVAL(binding);
816
+ if (!NIL_P(rb_transform_to)) {
817
+ rbgobj_object_add_relative(rb_binding, rb_transform_to);
818
+ }
819
+ if (!NIL_P(rb_transform_from)) {
820
+ rbgobj_object_add_relative(rb_binding, rb_transform_from);
821
+ }
755
822
  } else {
756
823
  binding = g_object_bind_property(source, source_property,
757
824
  target, target_property,
758
825
  flags);
826
+ rb_binding = GOBJ2RVAL(binding);
759
827
  }
760
828
 
761
- return GOBJ2RVAL(binding);
829
+ return rb_binding;
762
830
  }
763
831
  #endif
764
832
 
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2018 Ruby-GNOME2 Project Team
4
4
  * Copyright (C) 2003-2006 Ruby-GNOME2 Project Team
5
5
  * Copyright (C) 2002,2003 Masahiro Sakai
6
6
  * Copyright (C) 1998-2000 Yukihiro Matsumoto,
@@ -183,16 +183,25 @@ rbgobj_ruby_object_from_instance_with_unref(gpointer instance)
183
183
  void
184
184
  rbgobj_add_relative(VALUE obj, VALUE relative)
185
185
  {
186
- VALUE hash = Qnil;
186
+ static VALUE mGLibObject = Qnil;
187
+ if (NIL_P(mGLibObject)) {
188
+ mGLibObject = rb_const_get(mGLib, rb_intern("Object"));
189
+ }
187
190
 
188
- if (RVAL2CBOOL(rb_ivar_defined(obj, id_relatives)))
189
- hash = rb_ivar_get(obj, id_relatives);
191
+ if (rb_obj_is_kind_of(obj, mGLibObject)) {
192
+ rbgobj_object_add_relative(obj, relative);
193
+ } else {
194
+ VALUE hash = Qnil;
190
195
 
191
- if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) {
192
- hash = rb_hash_new();
193
- rb_ivar_set(obj, id_relatives, hash);
196
+ if (RVAL2CBOOL(rb_ivar_defined(obj, id_relatives)))
197
+ hash = rb_ivar_get(obj, id_relatives);
198
+
199
+ if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) {
200
+ hash = rb_hash_new();
201
+ rb_ivar_set(obj, id_relatives, hash);
202
+ }
203
+ rb_hash_aset(hash, relative, Qnil);
194
204
  }
195
- rb_hash_aset(hash, relative, Qnil);
196
205
  }
197
206
 
198
207
  void
@@ -207,16 +216,26 @@ rbgobj_invalidate_relatives(VALUE obj)
207
216
  void
208
217
  rbgobj_add_relative_removable(VALUE obj, VALUE relative, ID obj_ivar_id, VALUE hash_key)
209
218
  {
210
- VALUE hash = Qnil;
219
+ static VALUE cGLibObject = Qnil;
220
+ if (NIL_P(cGLibObject)) {
221
+ cGLibObject = rb_const_get(mGLib, rb_intern("Object"));
222
+ }
211
223
 
212
- if (RVAL2CBOOL(rb_ivar_defined(obj, obj_ivar_id)))
213
- hash = rb_ivar_get(obj, obj_ivar_id);
224
+ if (obj_ivar_id == rbgobj_id_children &&
225
+ rb_obj_is_kind_of(obj, cGLibObject)) {
226
+ rbgobj_object_add_relative(obj, hash_key);
227
+ } else {
228
+ VALUE hash = Qnil;
214
229
 
215
- if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) {
216
- hash = rb_hash_new();
217
- rb_ivar_set(obj, obj_ivar_id, hash);
230
+ if (RVAL2CBOOL(rb_ivar_defined(obj, obj_ivar_id)))
231
+ hash = rb_ivar_get(obj, obj_ivar_id);
232
+
233
+ if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) {
234
+ hash = rb_hash_new();
235
+ rb_ivar_set(obj, obj_ivar_id, hash);
236
+ }
237
+ rb_hash_aset(hash, hash_key, relative);
218
238
  }
219
- rb_hash_aset(hash, hash_key, relative);
220
239
  }
221
240
 
222
241
  VALUE
@@ -236,15 +255,25 @@ rbgobj_get_relative_removable(VALUE obj, ID obj_ivar_id, VALUE hash_key)
236
255
  void
237
256
  rbgobj_remove_relative(VALUE obj, ID obj_ivar_id, VALUE hash_key)
238
257
  {
239
- VALUE hash = Qnil;
240
-
241
- if (RVAL2CBOOL(rb_ivar_defined(obj, obj_ivar_id)))
242
- hash = rb_ivar_get(obj, obj_ivar_id);
258
+ static VALUE cGLibObject = Qnil;
259
+ if (NIL_P(cGLibObject)) {
260
+ cGLibObject = rb_const_get(mGLib, rb_intern("Object"));
261
+ }
243
262
 
244
- if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) {
245
- /* should not happen. */
263
+ if ((obj_ivar_id == id_relatives || obj_ivar_id == rbgobj_id_children) &&
264
+ rb_obj_is_kind_of(obj, cGLibObject)) {
265
+ rbgobj_object_remove_relative(obj, hash_key);
246
266
  } else {
247
- rb_funcall(hash, id_delete, 1, hash_key);
267
+ VALUE hash = Qnil;
268
+
269
+ if (RVAL2CBOOL(rb_ivar_defined(obj, obj_ivar_id)))
270
+ hash = rb_ivar_get(obj, obj_ivar_id);
271
+
272
+ if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) {
273
+ /* should not happen. */
274
+ } else {
275
+ rb_funcall(hash, id_delete, 1, hash_key);
276
+ }
248
277
  }
249
278
  }
250
279
 
@@ -79,6 +79,7 @@ RUBY_GLIB2_VAR ID rbgobj_id_children;
79
79
  (rbgobj_add_relative_removable(self, Qnil, rbgobj_id_children, child))
80
80
  #define G_CHILD_REMOVE(self, child) \
81
81
  (rbgobj_remove_relative(self, rbgobj_id_children, child))
82
+ /* Deprecated since 3.2.5. Use rbobj_object_remove_relatives() instead. */
82
83
  #define G_CHILD_REMOVE_ALL(self) \
83
84
  (rbgobj_remove_relative_all(self, rbgobj_id_children))
84
85
 
@@ -147,6 +148,13 @@ extern VALUE rbgobj_ruby_object_from_instance2(gpointer instance, gboolean alloc
147
148
  extern VALUE rbgobj_ruby_object_from_instance_with_unref(gpointer instance);
148
149
  extern void rbgobj_instance_unref(gpointer instance);
149
150
 
151
+ extern void rbgobj_object_add_relative(VALUE rb_gobject,
152
+ VALUE rb_relative);
153
+ extern void rbgobj_object_remove_relative(VALUE rb_gobject,
154
+ VALUE rb_relative);
155
+ extern void rbgobj_object_remove_relatives(VALUE rb_gobject,
156
+ VALUE rb_relative_class);
157
+
150
158
  extern void rbgobj_add_relative(VALUE obj, VALUE relative);
151
159
  extern void rbgobj_invalidate_relatives(VALUE obj);
152
160
  extern void rbgobj_add_relative_removable(VALUE obj, VALUE relative,
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2007-2017 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2007-2018 Ruby-GNOME2 Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -42,6 +42,7 @@ typedef struct {
42
42
  GObject* gobj;
43
43
  const RGObjClassInfo* cinfo;
44
44
  gboolean destroyed;
45
+ GHashTable *rb_relatives;
45
46
  } gobj_holder;
46
47
 
47
48
  typedef struct {
data/lib/2.2/glib2.so CHANGED
Binary file
data/lib/2.3/glib2.so CHANGED
Binary file
data/lib/2.4/glib2.so CHANGED
Binary file
data/lib/2.5/glib2.so CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib2
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.4
4
+ version: 3.2.5
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - The Ruby-GNOME2 Project Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-09 00:00:00.000000000 Z
11
+ date: 2018-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pkg-config