[vala] GObject: Reuse parent_class variable in constructors



commit 5a9161abdaa735a81ad8c51d29776f772ab3538d
Author: Jürg Billeter <j bitron ch>
Date:   Sat Sep 19 14:40:20 2009 +0200

    GObject: Reuse parent_class variable in constructors
    
    Fixes bug 559354.

 codegen/valagobjectmodule.vala |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/codegen/valagobjectmodule.vala b/codegen/valagobjectmodule.vala
index 6160901..6466dd0 100644
--- a/codegen/valagobjectmodule.vala
+++ b/codegen/valagobjectmodule.vala
@@ -462,10 +462,8 @@ internal class Vala.GObjectModule : GTypeModule {
 			ccast.add_argument (ccall);
 			cblock.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeIdentifier ("klass"), ccast)));
 
-			ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_type_class_peek_parent"));
-			ccall.add_argument (new CCodeIdentifier ("klass"));
 			ccast = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT_CLASS"));
-			ccast.add_argument (ccall);
+			ccast.add_argument (new CCodeIdentifier ("%s_parent_class".printf (cl.get_lower_case_cname (null))));
 			cblock.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeIdentifier ("parent_class"), ccast)));
 
 		



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