vala r1400 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1400 - in trunk: . gobject
- Date: Sun, 18 May 2008 18:36:36 +0000 (UTC)
Author: juergbi
Date: Sun May 18 18:36:36 2008
New Revision: 1400
URL: http://svn.gnome.org/viewvc/vala?rev=1400&view=rev
Log:
2008-05-18 Juerg Billeter <j bitron ch>
* gobject/valaccodegenerator.vala:
Use g_free as default free function for nullable value types
Modified:
trunk/ChangeLog
trunk/gobject/valaccodegenerator.vala
Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala (original)
+++ trunk/gobject/valaccodegenerator.vala Sun May 18 18:36:36 2008
@@ -1306,10 +1306,19 @@
}
} else if (type.data_type != null) {
string unref_function;
- if (type.data_type.is_reference_counting ()) {
- unref_function = type.data_type.get_unref_function ();
+ if (type is ReferenceType) {
+ if (type.data_type.is_reference_counting ()) {
+ unref_function = type.data_type.get_unref_function ();
+ } else {
+ unref_function = type.data_type.get_free_function ();
+ }
} else {
- unref_function = type.data_type.get_free_function ();
+ if (type.nullable) {
+ unref_function = type.data_type.get_free_function ();
+ if (unref_function == null) {
+ unref_function = "g_free";
+ }
+ }
}
if (unref_function == null) {
return new CCodeConstant ("NULL");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]