gobject-introspection 3.2.0 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '0182b6678b56a082c8328034ffff672c7943928e'
4
- data.tar.gz: 44810c310477e95dda3556d7fc41550dadc07cff
3
+ metadata.gz: 0631eb026f860babe2ffcc07681fb96284fc5a0f
4
+ data.tar.gz: 59ce32989a1225c10425b109256066d129758689
5
5
  SHA512:
6
- metadata.gz: 2deea40c1ef44a028757f224ee056b8769d6c9207a1c76c221649be706174569ba844960ca3ca0a58b338f70560efa87cc862654987097f8d9304f1d62b67c15
7
- data.tar.gz: 03637b3842ebe3ec5c9ee258494625fb0ab47f7fdb390557bf70af823191ab1c0c181295562a5a4304dd0ae66b2ec790b0f1bb9eac0fbe22606cae2426c29ed3
6
+ metadata.gz: d2e6517ef882043da5372a912cec39e90b7910fec1636cab94ff5068e12ea8c7a6d41ac24e9ce537316c3c970c38910c60bd3c9f4c7cbccc08acb3a9e9a36761
7
+ data.tar.gz: 0fc3b6155f58af1f5e9efc8348688fd3e7178a4abfc5eb597b652a0e3d609feead0e591d5088e59e40793d35bf03633086b1f661bcf385d65674166ea25d82e7
@@ -22,6 +22,21 @@
22
22
 
23
23
  static VALUE rb_cGLibValue = Qnil;
24
24
 
25
+ static const gchar *
26
+ rb_gi_transfer_to_string(GITransfer transfer)
27
+ {
28
+ switch(transfer) {
29
+ case GI_TRANSFER_NOTHING:
30
+ return "nothing";
31
+ case GI_TRANSFER_CONTAINER:
32
+ return "container";
33
+ case GI_TRANSFER_EVERYTHING:
34
+ return "everything";
35
+ default:
36
+ return "unknown";
37
+ }
38
+ }
39
+
25
40
  static void
26
41
  array_c_to_ruby_sized_interface(gconstpointer *elements,
27
42
  gint64 n_elements,
@@ -1580,6 +1595,8 @@ rb_gi_out_argument_init_interface(GIArgument *argument,
1580
1595
  {
1581
1596
  gsize struct_size;
1582
1597
 
1598
+ /* Should we care gtype?
1599
+ Related: rb_gi_out_argument_fin_interface() */
1583
1600
  struct_size = g_struct_info_get_size(interface_info);
1584
1601
  argument->v_pointer = xmalloc(struct_size);
1585
1602
  memset(argument->v_pointer, 0, struct_size);
@@ -1877,7 +1894,8 @@ static void
1877
1894
  rb_gi_out_argument_fin_array_c(GIArgument *argument,
1878
1895
  G_GNUC_UNUSED GIArgInfo *arg_info,
1879
1896
  G_GNUC_UNUSED GITypeInfo *array_type_info,
1880
- GITypeInfo *element_type_info)
1897
+ GITypeInfo *element_type_info,
1898
+ GITransfer transfer)
1881
1899
  {
1882
1900
  GITypeTag element_type_tag;
1883
1901
 
@@ -1893,6 +1911,9 @@ rb_gi_out_argument_fin_array_c(GIArgument *argument,
1893
1911
  g_type_tag_to_string(element_type_tag));
1894
1912
  break;
1895
1913
  case GI_TYPE_TAG_UINT8:
1914
+ if (transfer == GI_TRANSFER_EVERYTHING) {
1915
+ g_free(*((guint8 **)(argument->v_pointer)));
1916
+ }
1896
1917
  xfree(argument->v_pointer);
1897
1918
  break;
1898
1919
  case GI_TYPE_TAG_INT16:
@@ -1910,6 +1931,9 @@ rb_gi_out_argument_fin_array_c(GIArgument *argument,
1910
1931
  g_type_tag_to_string(element_type_tag));
1911
1932
  break;
1912
1933
  case GI_TYPE_TAG_UTF8:
1934
+ if (transfer != GI_TRANSFER_NOTHING) {
1935
+ g_free(*((gchar **)argument->v_pointer));
1936
+ }
1913
1937
  xfree(argument->v_pointer);
1914
1938
  break;
1915
1939
  case GI_TYPE_TAG_FILENAME:
@@ -1920,6 +1944,16 @@ rb_gi_out_argument_fin_array_c(GIArgument *argument,
1920
1944
  g_type_tag_to_string(element_type_tag));
1921
1945
  break;
1922
1946
  case GI_TYPE_TAG_INTERFACE:
1947
+ if (transfer == GI_TRANSFER_EVERYTHING) {
1948
+ g_base_info_unref(element_type_info);
1949
+ rb_raise(rb_eNotImpError,
1950
+ "TODO: free out transfer GIArgument(array)[c][%s][%s]",
1951
+ g_type_tag_to_string(element_type_tag),
1952
+ rb_gi_transfer_to_string(transfer));
1953
+ }
1954
+ if (transfer != GI_TRANSFER_NOTHING) {
1955
+ g_free(*((gpointer *)argument->v_pointer));
1956
+ }
1923
1957
  xfree(argument->v_pointer);
1924
1958
  break;
1925
1959
  case GI_TYPE_TAG_GLIST:
@@ -1942,7 +1976,8 @@ rb_gi_out_argument_fin_array_c(GIArgument *argument,
1942
1976
  static void
1943
1977
  rb_gi_out_argument_fin_array(GIArgument *argument,
1944
1978
  GIArgInfo *arg_info,
1945
- GITypeInfo *array_type_info)
1979
+ GITypeInfo *array_type_info,
1980
+ GITransfer transfer)
1946
1981
  {
1947
1982
  GIArrayType array_type;
1948
1983
  GITypeInfo *element_type_info;
@@ -1957,9 +1992,17 @@ rb_gi_out_argument_fin_array(GIArgument *argument,
1957
1992
  rb_gi_out_argument_fin_array_c(argument,
1958
1993
  arg_info,
1959
1994
  array_type_info,
1960
- element_type_info);
1995
+ element_type_info,
1996
+ transfer);
1961
1997
  break;
1962
1998
  case GI_ARRAY_TYPE_ARRAY:
1999
+ if (transfer != GI_TRANSFER_NOTHING) {
2000
+ g_base_info_unref(element_type_info);
2001
+ rb_raise(rb_eNotImpError,
2002
+ "TODO: free out transfer GIArgument(array)[ptr-array][%s][%s]",
2003
+ g_type_tag_to_string(element_type_tag),
2004
+ rb_gi_transfer_to_string(transfer));
2005
+ }
1963
2006
  g_array_free(argument->v_pointer, TRUE);
1964
2007
  break;
1965
2008
  case GI_ARRAY_TYPE_PTR_ARRAY:
@@ -1983,11 +2026,88 @@ rb_gi_out_argument_fin_array(GIArgument *argument,
1983
2026
  g_base_info_unref(element_type_info);
1984
2027
  }
1985
2028
 
2029
+ static void
2030
+ rb_gi_out_argument_fin_interface(GIArgument *argument,
2031
+ G_GNUC_UNUSED GIArgInfo *arg_info,
2032
+ GITypeInfo *interface_type_info,
2033
+ GITransfer transfer)
2034
+ {
2035
+ GIBaseInfo *interface_info;
2036
+ GIInfoType interface_type;
2037
+
2038
+ interface_info = g_type_info_get_interface(interface_type_info);
2039
+ interface_type = g_base_info_get_type(interface_info);
2040
+ g_base_info_unref(interface_info);
2041
+
2042
+ switch (interface_type) {
2043
+ case GI_INFO_TYPE_INVALID:
2044
+ case GI_INFO_TYPE_FUNCTION:
2045
+ case GI_INFO_TYPE_CALLBACK:
2046
+ rb_raise(rb_eNotImpError,
2047
+ "TODO: free out transfer GIArgument(interface)[%s][%s]",
2048
+ g_info_type_to_string(interface_type),
2049
+ rb_gi_transfer_to_string(transfer));
2050
+ break;
2051
+ case GI_INFO_TYPE_STRUCT:
2052
+ /* Should we care gtype?
2053
+ Related: rb_gi_out_argument_init_interface() */
2054
+ xfree(argument->v_pointer);
2055
+ break;
2056
+ case GI_INFO_TYPE_BOXED:
2057
+ rb_raise(rb_eNotImpError,
2058
+ "TODO: free out transfer GIArgument(interface)[%s][%s]",
2059
+ g_info_type_to_string(interface_type),
2060
+ rb_gi_transfer_to_string(transfer));
2061
+ break;
2062
+ case GI_INFO_TYPE_ENUM:
2063
+ case GI_INFO_TYPE_FLAGS:
2064
+ break;
2065
+ case GI_INFO_TYPE_OBJECT:
2066
+ if (transfer != GI_TRANSFER_NOTHING) {
2067
+ rb_raise(rb_eNotImpError,
2068
+ "TODO: free out transfer GIArgument(interface)[%s][%s]",
2069
+ g_info_type_to_string(interface_type),
2070
+ rb_gi_transfer_to_string(transfer));
2071
+ }
2072
+ xfree(argument->v_pointer);
2073
+ break;
2074
+ case GI_INFO_TYPE_INTERFACE:
2075
+ if (transfer != GI_TRANSFER_NOTHING) {
2076
+ rb_raise(rb_eNotImpError,
2077
+ "TODO: free out transfer GIArgument(interface)[%s][%s]",
2078
+ g_info_type_to_string(interface_type),
2079
+ rb_gi_transfer_to_string(transfer));
2080
+ }
2081
+ xfree(argument->v_pointer);
2082
+ break;
2083
+ case GI_INFO_TYPE_CONSTANT:
2084
+ case GI_INFO_TYPE_INVALID_0:
2085
+ case GI_INFO_TYPE_UNION:
2086
+ case GI_INFO_TYPE_VALUE:
2087
+ case GI_INFO_TYPE_SIGNAL:
2088
+ case GI_INFO_TYPE_VFUNC:
2089
+ case GI_INFO_TYPE_PROPERTY:
2090
+ case GI_INFO_TYPE_FIELD:
2091
+ case GI_INFO_TYPE_ARG:
2092
+ case GI_INFO_TYPE_TYPE:
2093
+ case GI_INFO_TYPE_UNRESOLVED:
2094
+ rb_raise(rb_eNotImpError,
2095
+ "TODO: free out transfer GIArgument(interface)[%s][%s]",
2096
+ g_info_type_to_string(interface_type),
2097
+ rb_gi_transfer_to_string(transfer));
2098
+ break;
2099
+ default:
2100
+ g_assert_not_reached();
2101
+ break;
2102
+ }
2103
+ }
2104
+
1986
2105
  void
1987
2106
  rb_gi_out_argument_fin(GIArgument *argument, GIArgInfo *arg_info)
1988
2107
  {
1989
2108
  GITypeInfo type_info;
1990
2109
  GITypeTag type_tag;
2110
+ GITransfer transfer;
1991
2111
 
1992
2112
  if (g_arg_info_get_direction(arg_info) != GI_DIRECTION_OUT) {
1993
2113
  return;
@@ -1995,6 +2115,7 @@ rb_gi_out_argument_fin(GIArgument *argument, GIArgInfo *arg_info)
1995
2115
 
1996
2116
  g_arg_info_load_type(arg_info, &type_info);
1997
2117
  type_tag = g_type_info_get_tag(&type_info);
2118
+ transfer = g_arg_info_get_ownership_transfer(arg_info);
1998
2119
 
1999
2120
  switch (type_tag) {
2000
2121
  case GI_TYPE_TAG_VOID:
@@ -2010,7 +2131,12 @@ rb_gi_out_argument_fin(GIArgument *argument, GIArgInfo *arg_info)
2010
2131
  case GI_TYPE_TAG_FLOAT:
2011
2132
  case GI_TYPE_TAG_DOUBLE:
2012
2133
  case GI_TYPE_TAG_GTYPE:
2134
+ xfree(argument->v_pointer);
2135
+ break;
2013
2136
  case GI_TYPE_TAG_UTF8:
2137
+ if (transfer != GI_TRANSFER_NOTHING) {
2138
+ g_free(*((gchar **)argument->v_pointer));
2139
+ }
2014
2140
  xfree(argument->v_pointer);
2015
2141
  break;
2016
2142
  case GI_TYPE_TAG_FILENAME:
@@ -2019,13 +2145,37 @@ rb_gi_out_argument_fin(GIArgument *argument, GIArgInfo *arg_info)
2019
2145
  g_type_tag_to_string(type_tag));
2020
2146
  break;
2021
2147
  case GI_TYPE_TAG_ARRAY:
2022
- rb_gi_out_argument_fin_array(argument, arg_info, &type_info);
2148
+ rb_gi_out_argument_fin_array(argument, arg_info, &type_info, transfer);
2023
2149
  break;
2024
2150
  case GI_TYPE_TAG_INTERFACE:
2151
+ rb_gi_out_argument_fin_interface(argument,
2152
+ arg_info,
2153
+ &type_info,
2154
+ transfer);
2155
+ break;
2025
2156
  case GI_TYPE_TAG_GLIST:
2157
+ if (transfer == GI_TRANSFER_EVERYTHING) {
2158
+ rb_raise(rb_eNotImpError,
2159
+ "TODO: free out transfer GIArgument(%s)[%s]",
2160
+ g_type_tag_to_string(type_tag),
2161
+ rb_gi_transfer_to_string(transfer));
2162
+ }
2163
+ if (transfer != GI_TRANSFER_NOTHING) {
2164
+ g_list_free(*((GList **)argument->v_pointer));
2165
+ }
2166
+ xfree(argument->v_pointer);
2167
+ break;
2026
2168
  case GI_TYPE_TAG_GSLIST:
2027
2169
  case GI_TYPE_TAG_GHASH:
2028
2170
  case GI_TYPE_TAG_ERROR:
2171
+ if (transfer != GI_TRANSFER_NOTHING) {
2172
+ rb_raise(rb_eNotImpError,
2173
+ "TODO: free out transfer GIArgument(%s)[%s]",
2174
+ g_type_tag_to_string(type_tag),
2175
+ rb_gi_transfer_to_string(transfer));
2176
+ }
2177
+ xfree(argument->v_pointer);
2178
+ break;
2029
2179
  case GI_TYPE_TAG_UNICHAR:
2030
2180
  xfree(argument->v_pointer);
2031
2181
  break;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gobject-introspection
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME2 Project Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-07 00:00:00.000000000 Z
11
+ date: 2017-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glib2
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.2.0
19
+ version: 3.2.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.2.0
26
+ version: 3.2.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: test-unit
29
29
  requirement: !ruby/object:Gem::Requirement