vala r1592 - in trunk: . gobject vala
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1592 - in trunk: . gobject vala
- Date: Sun, 15 Jun 2008 22:30:38 +0000 (UTC)
Author: juergbi
Date: Sun Jun 15 22:30:38 2008
New Revision: 1592
URL: http://svn.gnome.org/viewvc/vala?rev=1592&view=rev
Log:
2008-06-16 JÃrg Billeter <j bitron ch>
* vala/valaerrortype.vala:
* vala/valasemanticanalyzer.vala:
* gobject/valaccodegenerator.vala:
Fix memory management of error types, fixes bug 537951
Modified:
trunk/ChangeLog
trunk/gobject/valaccodegenerator.vala
trunk/vala/valaerrortype.vala
trunk/vala/valasemanticanalyzer.vala
Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala (original)
+++ trunk/gobject/valaccodegenerator.vala Sun Jun 15 22:30:38 2008
@@ -1372,6 +1372,8 @@
} else {
return new CCodeIdentifier (type.data_type.get_free_function ());
}
+ } else if (type is ErrorType) {
+ return new CCodeIdentifier ("g_error_free");
} else if (type.data_type != null) {
string unref_function;
if (type is ReferenceType) {
Modified: trunk/vala/valaerrortype.vala
==============================================================================
--- trunk/vala/valaerrortype.vala (original)
+++ trunk/vala/valaerrortype.vala Sun Jun 15 22:30:38 2008
@@ -69,7 +69,12 @@
}
public override DataType copy () {
- return new ErrorType (error_domain, source_reference);
+ var result = new ErrorType (error_domain, source_reference);
+ result.source_reference = source_reference;
+ result.value_owned = value_owned;
+ result.nullable = nullable;
+
+ return result;
}
public override string? get_cname () {
@@ -107,4 +112,8 @@
public override string? get_type_id () {
return "G_TYPE_POINTER";
}
+
+ public override bool is_reference_type_or_type_parameter () {
+ return true;
+ }
}
Modified: trunk/vala/valasemanticanalyzer.vala
==============================================================================
--- trunk/vala/valasemanticanalyzer.vala (original)
+++ trunk/vala/valasemanticanalyzer.vala Sun Jun 15 22:30:38 2008
@@ -1210,6 +1210,9 @@
}
public override void visit_throw_statement (ThrowStatement stmt) {
+ stmt.error_expression.target_type = new ErrorType (null, stmt.source_reference);
+ stmt.error_expression.target_type.value_owned = true;
+
stmt.accept_children (this);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]