On Sun, 2008-02-10 at 00:09 -0500, Kevin Wright wrote:
> I have pasted a paraphrasing of the problem code -- the destroy is
> supposed to be in a callback after a timeline runs out. However, even if
> I hard code something almost exactly the same as what I included below,
> it still crashes when trying to destroy it.
>
> Any ideas?
>
>
> /"GdkPixbuf *pixb;
> ClutterActor *explosion;
>
> explosion=g_new0(ClutterActor,1);
eek, what is this? you don't need to allocate a ClutterActor with
g_new0().
> pixb = gdk_pixbuf_new_from_file ("images/explosion.png", NULL);
you should really check the return value and/or pass a GError location
to this function; it shouldn't really matter but it's a best practise.
> explosion = clutter_texture_new_from_pixbuf (pixb);
now you are leaking the memory you allocated before with g_new0().
> clutter_group_add (CLUTTER_GROUP(stage), explosion);
this should really be:
clutter_container_add_actor (CLUTTER_CONTAINER (stage), explosion);
> clutter_actor_set_position (explosion, 200,300);
>
> clutter_actor_show (explosion);
>
> clutter_actor_destroy (explosion);"/
and why are you destroying the texture? unless you want to remove it
from the container, which should really be done with
clutter_container_remove() anyway.
this is hardly working code - let alone meaningful code. could you
please write a small working example that exhibits the crash? also it
would be better to attach a backtrace of the segmentation fault obtained
with gdb.
ciao,
Emmanuele.
--
Emmanuele Bassi, OpenedHand Ltd.
Unit R, Homesdale Business Centre
216-218 Homesdale Rd., Bromley - BR12QZ
http://www.o-hand.com
--
To unsubscribe send a mail to [EMAIL PROTECTED]