[vala] codegen: Fix detailed signal disconnect in async methods
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Fix detailed signal disconnect in async methods
- Date: Mon, 12 Jan 2015 14:10:40 +0000 (UTC)
commit c0ae346ac099fb6e8bfa59dba03ac7412523183f
Author: Luca Bruno <lucabru src gnome org>
Date: Mon Jan 12 15:09:14 2015 +0100
codegen: Fix detailed signal disconnect in async methods
Fixes bug 742621
codegen/valagsignalmodule.vala | 2 +-
tests/Makefile.am | 1 +
tests/asynchronous/bug742621.vala | 15 +++++++++++++++
3 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagsignalmodule.vala b/codegen/valagsignalmodule.vala
index 3f8e1ea..eff6781 100644
--- a/codegen/valagsignalmodule.vala
+++ b/codegen/valagsignalmodule.vala
@@ -618,7 +618,7 @@ public class Vala.GSignalModule : GObjectModule {
} else {
detail_temp_decl = get_temp_variable (gquark_type);
emit_temp_var (detail_temp_decl);
- parse_call.add_argument (new CCodeUnaryExpression
(CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (detail_temp_decl.name)));
+ parse_call.add_argument (new CCodeUnaryExpression
(CCodeUnaryOperator.ADDRESS_OF, get_variable_cexpression (detail_temp_decl.name)));
parse_call.add_argument (new CCodeConstant ("TRUE"));
}
ccode.add_expression (parse_call);
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a9bd40f..73fe7e3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -190,6 +190,7 @@ TESTS = \
asynchronous/bug654336.vala \
asynchronous/bug654337.vala \
asynchronous/bug661961.vala \
+ asynchronous/bug742621.vala \
asynchronous/closures.vala \
dbus/basic-types.test \
dbus/arrays.test \
diff --git a/tests/asynchronous/bug742621.vala b/tests/asynchronous/bug742621.vala
new file mode 100644
index 0000000..1577caf
--- /dev/null
+++ b/tests/asynchronous/bug742621.vala
@@ -0,0 +1,15 @@
+class Xyzzy : Object {
+ public bool b { get; set; }
+}
+
+Xyzzy? xyzzy = null;
+
+private void on_b() {
+}
+
+async void go_async() throws Error {
+ xyzzy.notify["b"].disconnect(on_b);
+}
+
+void main () {
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]