vala r2382 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r2382 - in trunk: . gobject
- Date: Sat, 17 Jan 2009 22:59:16 +0000 (UTC)
Author: juergbi
Date: Sat Jan 17 22:59:16 2009
New Revision: 2382
URL: http://svn.gnome.org/viewvc/vala?rev=2382&view=rev
Log:
2009-01-17 JÃrg Billeter <j bitron ch>
* gobject/valaccodemethodcallmodule.vala:
Fix crash when using lambda expressions with owned delegate
parameters, fixes bug 566344
Modified:
trunk/ChangeLog
trunk/gobject/valaccodemethodcallmodule.vala
Modified: trunk/gobject/valaccodemethodcallmodule.vala
==============================================================================
--- trunk/gobject/valaccodemethodcallmodule.vala (original)
+++ trunk/gobject/valaccodemethodcallmodule.vala Sat Jan 17 22:59:16 2009
@@ -237,10 +237,18 @@
if (deleg_type.value_owned) {
CCodeExpression delegate_target_destroy_notify;
var delegate_method = arg.symbol_reference as Method;
+ var lambda = arg as LambdaExpression;
var arg_ma = arg as MemberAccess;
- if (delegate_method != null && delegate_method.binding == MemberBinding.INSTANCE
- && arg_ma.inner != null && arg_ma.inner.value_type.data_type != null
- && arg_ma.inner.value_type.data_type.is_reference_counting ()) {
+ if (lambda != null && current_method != null && current_method.binding == MemberBinding.INSTANCE) {
+ // type of delegate target is same as `this'
+ // for lambda expressions in instance methods
+ var ref_call = new CCodeFunctionCall (get_dup_func_expression (current_method.this_parameter.parameter_type, arg.source_reference));
+ ref_call.add_argument (delegate_target);
+ delegate_target = ref_call;
+ delegate_target_destroy_notify = get_destroy_func_expression (current_method.this_parameter.parameter_type);
+ } else if (delegate_method != null && delegate_method.binding == MemberBinding.INSTANCE
+ && arg_ma != null && arg_ma.inner != null && arg_ma.inner.value_type.data_type != null
+ && arg_ma.inner.value_type.data_type.is_reference_counting ()) {
var ref_call = new CCodeFunctionCall (get_dup_func_expression (arg_ma.inner.value_type, arg.source_reference));
ref_call.add_argument (delegate_target);
delegate_target = ref_call;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]