On Wed, 2008-06-18 at 13:58 +0800, HASWANI HARISH-VCKR47 wrote: > Hi All, > > Here is my confusion : ptr is an actor, which is added to stage. > Later on unreferenced and initialized with new texture. After adding new > texture, I am adding again this ptr to stage. > Here is code: > > > ClutterActor *ptr=clutter_texture_new_from_pixbuf(pixbuf);
as soon as you add an actor to a container, the container takes ownership of the actor and ptr can be assigned to whatever other actor you want. > . > . > g_object_unref(G_OBJECT(ptr)) no, you can't do this: you don't own the actor anymore. you actually never did, as the actor has a "floating reference" which is sunk by the container. > ptr=clutter_texture_new_from_pixbuf(pixbuf1); if you are replacing the texture, you need to destroy the previous texture actor with: clutter_actor_destroy (texture); and then create a new texture and add it to the stage; clutter_actor_destroy() will take care of removing the actor for you and of disposing it. if you are merely replacing the image inside the texture, use: clutter_texture_set_pixbuf (texture, pixbuf1); which will make things simpler. > Issue : when I am executing this piece of code. I am getting this error: > (./test-behave:530): Clutter-CRITICAL **: clutter_actor_paint: assertion > `CLUTTE > R_IS_ACTOR (self)' failed > > Please tell me where I am goofing up. you are goofing up in your lack of reading the documentation of Clutter and the documentation of GObject. please: read the documentation. 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]
