seed r266 - in trunk: examples/lightsoff libseed
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r266 - in trunk: examples/lightsoff libseed
- Date: Thu, 13 Nov 2008 08:58:27 +0000 (UTC)
Author: racarr
Date: Thu Nov 13 08:58:27 2008
New Revision: 266
URL: http://svn.gnome.org/viewvc/seed?rev=266&view=rev
Log:
Make sure all objects that go through seed have floating ref sunk.
Modified:
trunk/examples/lightsoff/board.js
trunk/examples/lightsoff/score.js
trunk/libseed/seed-types.c
Modified: trunk/examples/lightsoff/board.js
==============================================================================
--- trunk/examples/lightsoff/board.js (original)
+++ trunk/examples/lightsoff/board.js Thu Nov 13 08:58:27 2008
@@ -112,7 +112,7 @@
{
in_setup = true;
- var count = Math.round(tiles*5*Math.random());
+ var count = -4;
var sym = Math.floor(3*Math.random());
for (q = 0; q < count + 5; ++q)
Modified: trunk/examples/lightsoff/score.js
==============================================================================
--- trunk/examples/lightsoff/score.js (original)
+++ trunk/examples/lightsoff/score.js Thu Nov 13 08:58:27 2008
@@ -51,7 +51,10 @@
this.bkg_top = Clutter.Texture.new_from_file("./front.svg");
var bkg = Clutter.Texture.new_from_file("./back.svg");
var off_svg = Clutter.Texture.new_from_file("./off.svg");
-
+ Seed.print(bkg.__debug_ref_count());
+ Seed.print(this.bkg_top.__debug_ref_count());
+ Seed.print(off_svg.__debug_ref_count());
+
this.bkg_top.filter_quality = Clutter.TextureQuality.high;
bkg.filter_quality = Clutter.TextureQuality.high;
off_svg.filter_quality = Clutter.TextureQuality.high;
@@ -80,8 +83,13 @@
this.bkg_top.set_position(1, 1);
this.add_actor(this.bkg_top);
+
+ this.animate_value(0); Seed.print(bkg.__debug_ref_count());
+ Seed.print(this.bkg_top.__debug_ref_count());
+ Seed.print(off_svg.__debug_ref_count());
+
- this.animate_value(0);
+
}};
Score = new GType(ScoreType);
Modified: trunk/libseed/seed-types.c
==============================================================================
--- trunk/libseed/seed-types.c (original)
+++ trunk/libseed/seed-types.c Thu Nov 13 08:58:27 2008
@@ -93,11 +93,13 @@
g_assert_not_reached();
}
+ g_object_ref_sink(object);
g_object_set_data_full(object, "js-ref", (gpointer) js_ref,
seed_gobject_destroyed);
JSValueProtect(eng->context, js_ref);
g_object_add_toggle_ref(object, seed_toggle_ref, (gpointer) js_ref);
+ g_object_unref(object);
return js_ref;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]