diff options
author | Jürg Billeter <j@bitron.ch> | 2010-10-22 15:40:23 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2010-10-23 18:11:46 +0200 |
commit | 63172079a648519997c859c96d7279c31cec2b80 (patch) | |
tree | 3552b14d8f7ea5cecaf6eed3d4fb469c2f41736f /codegen/valagerrormodule.vala | |
parent | 02ff2621a2ab49a783c80ff78bca9bbb0838c43d (diff) | |
download | vala-63172079a648519997c859c96d7279c31cec2b80.tar.gz |
codegen: Fix uncaught errors in constructors and destructors
Diffstat (limited to 'codegen/valagerrormodule.vala')
-rw-r--r-- | codegen/valagerrormodule.vala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/codegen/valagerrormodule.vala b/codegen/valagerrormodule.vala index b7b4436ad..3ccc68f34 100644 --- a/codegen/valagerrormodule.vala +++ b/codegen/valagerrormodule.vala @@ -135,7 +135,9 @@ public class Vala.GErrorModule : CCodeDelegateModule { ccode.add_expression (ccritical); ccode.add_expression (cclear); - if (current_method is CreationMethod) { + if (is_in_constructor () || is_in_destructor ()) { + // just print critical, do not return prematurely + } else if (current_method is CreationMethod) { if (current_method.parent_symbol is Struct) { ccode.add_return (); } else { |