summaryrefslogtreecommitdiff
path: root/vala/valamemorymanager.vala
diff options
context:
space:
mode:
authorJuerg Billeter <j@bitron.ch>2007-12-14 21:14:23 +0000
committerJürg Billeter <juergbi@src.gnome.org>2007-12-14 21:14:23 +0000
commit455f789b57f7bf8682e303f6abf1a0bfb0312aeb (patch)
tree997ae686907015722719833de872eba219b7ca74 /vala/valamemorymanager.vala
parentc86c5d8580bc287b1259de466f9be5286c21151d (diff)
downloadvala-455f789b57f7bf8682e303f6abf1a0bfb0312aeb.tar.gz
move reference type check from MemoryManager to DataType
2007-12-14 Juerg Billeter <j@bitron.ch> * vala/valadatatype.vala, vala/valamemorymanager.vala: move reference type check from MemoryManager to DataType svn path=/trunk/; revision=769
Diffstat (limited to 'vala/valamemorymanager.vala')
-rw-r--r--vala/valamemorymanager.vala16
1 files changed, 4 insertions, 12 deletions
diff --git a/vala/valamemorymanager.vala b/vala/valamemorymanager.vala
index 143578418..21fdf311e 100644
--- a/vala/valamemorymanager.vala
+++ b/vala/valamemorymanager.vala
@@ -42,9 +42,7 @@ public class Vala.MemoryManager : CodeVisitor {
private void visit_possibly_leaked_expression (Expression! expr) {
if (expr.static_type != null &&
- ((expr.static_type.data_type != null &&
- expr.static_type.data_type.is_reference_type ()) ||
- expr.static_type.type_parameter != null) &&
+ expr.static_type.is_reference_type_or_type_parameter () &&
expr.static_type.transfers_ownership) {
/* mark reference as leaked */
expr.ref_leaked = true;
@@ -53,9 +51,7 @@ public class Vala.MemoryManager : CodeVisitor {
private void visit_possibly_missing_copy_expression (Expression! expr) {
if (expr.static_type != null &&
- ((expr.static_type.data_type != null &&
- expr.static_type.data_type.is_reference_type ()) ||
- expr.static_type.type_parameter != null) &&
+ expr.static_type.is_reference_type_or_type_parameter () &&
!expr.static_type.transfers_ownership) {
/* mark reference as missing */
expr.ref_missing = true;
@@ -213,9 +209,7 @@ public class Vala.MemoryManager : CodeVisitor {
if (params_it.next ()) {
var param = params_it.get ();
if (!param.ellipsis
- && ((param.type_reference.data_type != null
- && param.type_reference.data_type.is_reference_type ())
- || param.type_reference.type_parameter != null)) {
+ && param.type_reference.is_reference_type_or_type_parameter ()) {
bool is_ref = param.type_reference.transfers_ownership;
if (is_ref && param.type_reference.type_parameter != null) {
if (expr.call is MemberAccess) {
@@ -256,9 +250,7 @@ public class Vala.MemoryManager : CodeVisitor {
if (params_it.next ()) {
var param = params_it.get ();
if (!param.ellipsis
- && ((param.type_reference.data_type != null
- && param.type_reference.data_type.is_reference_type ())
- || param.type_reference.type_parameter != null)) {
+ && param.type_reference.is_reference_type_or_type_parameter ()) {
bool is_ref = param.type_reference.transfers_ownership;
if (is_ref && param.type_reference.type_parameter != null) {
var param_type = SemanticAnalyzer.get_actual_type (expr.type_reference, msym, param.type_reference, expr);