From b1d1fbfb62b3269dec1be29b4e0750d9cf831ef6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrg=20Billeter?= Date: Sat, 31 May 2008 11:21:26 +0000 Subject: [PATCH] Allow non-null sender parameter in signal handlers MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 2008-05-31 Jürg Billeter * vala/valasignal.vala: Allow non-null sender parameter in signal handlers svn path=/trunk/; revision=1513 --- ChangeLog | 6 ++++++ vala/valasignal.vala | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7927a91..e761d6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-05-31 Jürg Billeter + * vala/valasignal.vala: + + Allow non-null sender parameter in signal handlers + +2008-05-31 Jürg Billeter + * vala/valasemanticanalyzer.vala: Fix ownership for constant arrays of structs, fixes bug 535560 diff --git a/vala/valasignal.vala b/vala/valasignal.vala index fd454be..4f6d69a 100644 --- a/vala/valasignal.vala +++ b/vala/valasignal.vala @@ -99,7 +99,12 @@ public class Vala.Signal : Member, Lockable { var generated_delegate = new Delegate (null, return_type); generated_delegate.has_target = true; - var sender_param = new FormalParameter ("_sender", sender_type.copy ()); + // sender parameter is never null and doesn't own its value + var sender_param_type = sender_type.copy (); + sender_param_type.value_owned = false; + sender_param_type.nullable = false; + + var sender_param = new FormalParameter ("_sender", sender_param_type); generated_delegate.add_parameter (sender_param); foreach (FormalParameter param in parameters) { -- 2.7.4