[vala] codegen: Fix regression when setting delegate properties
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Fix regression when setting delegate properties
- Date: Wed, 22 Jun 2011 06:43:43 +0000 (UTC)
commit e514de6545158e5974730cf2a95b6fa942ab3870
Author: Luca Bruno <lucabru src gnome org>
Date: Wed Jun 22 08:40:45 2011 +0200
codegen: Fix regression when setting delegate properties
The regression was introduced by 1e90d53dba0eff6ec2b.
Fixes bug 653138.
codegen/valaccodebasemodule.vala | 2 +-
tests/Makefile.am | 1 +
tests/objects/bug653138.vala | 10 ++++++++++
3 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index dffd20e..9f4a13a 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -5394,7 +5394,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
var delegate_type = (DelegateType) prop.property_type;
if (delegate_type.delegate_symbol.has_target) {
ccall.add_argument (get_delegate_target_cvalue (value));
- if (delegate_type.value_owned) {
+ if (base_property.set_accessor.value_type.value_owned) {
ccall.add_argument (get_delegate_target_destroy_notify_cvalue (value));
}
}
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9819401..dec5ed9 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -91,6 +91,7 @@ TESTS = \
objects/bug628639.vala \
objects/bug642809.vala \
objects/bug643711.vala \
+ objects/bug653138.vala \
errors/errors.vala \
errors/bug567181.vala \
errors/bug579101.vala \
diff --git a/tests/objects/bug653138.vala b/tests/objects/bug653138.vala
new file mode 100644
index 0000000..75434a2
--- /dev/null
+++ b/tests/objects/bug653138.vala
@@ -0,0 +1,10 @@
+public class Foo {
+ public SourceFunc foo { private set; get; }
+
+ public void bar () {
+ foo = null;
+ }
+}
+
+void main() {
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]