[seed] [libseed] All Seed created GTypes have the same construct function (seed_gtype_construct), and so wh



commit 6932a8fff032b8c04ce6003bc0beff6cf61ba3b9
Author: Robert Carr <racarr gnome org>
Date:   Wed Jul 29 03:51:27 2009 -0400

    [libseed] All Seed created GTypes have the same construct function (seed_gtype_construct), and so when chaining to the parent constructor, it is neccessary to explicitly pass the parent type rather than the constructor type, or suffer imminent stack overflow closes 590049. This was introduced in the switch from using init to constructors. Also includes a test

 libseed/seed-gtype.c                   |    2 +-
 tests/javascript/gtypes/Makefile.am    |    1 +
 tests/javascript/gtypes/gtype-gtype.js |   26 ++++++++++++++++++++++++++
 3 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/libseed/seed-gtype.c b/libseed/seed-gtype.c
index 4a20a73..113eaf3 100644
--- a/libseed/seed-gtype.c
+++ b/libseed/seed-gtype.c
@@ -307,7 +307,7 @@ seed_gtype_construct (GType type,
   parent = g_type_parent (type);
   parent_class = g_type_class_ref (parent);
 
-  object = parent_class->constructor (type, n_construct_params, construct_params);
+  object = parent_class->constructor (parent, n_construct_params, construct_params);
 
   g_type_class_unref (parent_class);
 
diff --git a/tests/javascript/gtypes/Makefile.am b/tests/javascript/gtypes/Makefile.am
index 8c0778c..93a3f7d 100644
--- a/tests/javascript/gtypes/Makefile.am
+++ b/tests/javascript/gtypes/Makefile.am
@@ -3,6 +3,7 @@ EXTRA_DIST = \
 	gtype-property.js \
 	gtype-typerror.js \
 	gtype.js \
+	gtype-gtype.js \
 	gtype-signal-args.js \
 	gtype-property-construct.js \
 	gtype-self.js \
diff --git a/tests/javascript/gtypes/gtype-gtype.js b/tests/javascript/gtypes/gtype-gtype.js
new file mode 100755
index 0000000..b34c631
--- /dev/null
+++ b/tests/javascript/gtypes/gtype-gtype.js
@@ -0,0 +1,26 @@
+#!/usr/bin/env seed
+// Returns: 0
+// STDIN:
+// STDOUT:
+// STDERR:
+
+Gtk = imports.gi.Gtk;
+Gtk.init(Seed.argv);
+
+HelloWindowType = {
+    parent: Gtk.Window.type,
+    name: "HelloWindow"
+};
+
+HelloWindow = new GType(HelloWindowType);
+w = new HelloWindow();
+
+InheritedWindowType = {
+ parent: HelloWindow.type,
+ name: "InheritedWindow"
+};
+
+InheritedWindow = new GType(InheritedWindowType);
+
+b = new InheritedWindow();
+



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