Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
/*
* Returns a GArray of struct enum_range or NULL.
- * Caller must release the GArray with g_array_unref().
+ * Callers do _not_ own the returned GArray (and therefore _don't_ need to
+ * release it).
*/
GArray *enum_quark_to_range_set(const struct type_class_enum *enum_class,
GQuark q);
g_array_index(ranges, struct enum_range, ranges->len) = iter->range;
}
}
- if (!ranges)
+ if (!ranges) {
ranges = qs;
+ g_array_ref(ranges);
+ }
return ranges;
}
g_array_index(ranges, struct enum_range, ranges->len) = iter->range;
}
}
- if (!ranges)
+ if (!ranges) {
ranges = qs;
+ g_array_ref(ranges);
+ }
return ranges;
}