[vala] GIR writer: Fix crash on struct creation methods



commit 7b6b40f569fffbc6fd0d64cc671867b1f312f446
Author: Luca Bruno <lethalman88 gmail com>
Date:   Mon Jun 14 23:23:25 2010 +0200

    GIR writer: Fix crash on struct creation methods
    
    Fixes bug 621495.

 codegen/valagirwriter.vala |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index 33fd77e..be1daa4 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -691,7 +691,8 @@ public class Vala.GIRWriter : CodeVisitor {
 
 		write_indent ();
 
-		if (m == ((Class)m.parent_symbol).default_construction_method) {
+		if (m.parent_symbol is Class && m == ((Class)m.parent_symbol).default_construction_method ||
+			m.parent_symbol is Struct && m == ((Struct)m.parent_symbol).default_construction_method) {
 			buffer.append_printf ("<constructor name=\"new\" c:identifier=\"%s\"", m.get_cname ());
 		} else {
 			buffer.append_printf ("<constructor name=\"%s\" c:identifier=\"%s\"", m.name, m.get_cname ());



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]