It could be I was reading other people's code wrong regarding g_new0, but it seemed to be doing what I expected it should do in their code as well as my own.

Emmanuele Bassi wrote:
On Sun, 2008-02-10 at 09:29 -0500, Kevin Wright wrote:
Besides, if I wanted to have more than one of my explosions could I not use g_new0?

unless you want to allocate an array of items, but in that case using
g_new0 will not do what you think it does.

And then what happens if I want to get rid of them? I usually use malloc but have been playing with g_new0 as I have seen others use it elsewhere.

those are mistakes, ore you're probably not reading them correctly.

Elsewhere I was creating arrays with it, and it worked just fine (at least as far as I could see on the surface). So it was certainly doing what I wanted it to do ... hopefully there isn't something that comes back to haunt me later by using it.

Regardless, this isn't related to the issue with clutter_actor_destroy.
clutter_texture_new() will allocate the correct space for you and return
a pointer to the actor; it returns ClutterActor* because a
ClutterTexture satisfies the ISA relationship, but the allocated space
is enough to contain a ClutterTexture, not just a ClutterActor.

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.
I'm destroying it because I want it gone for good -- it served a purpose and now I no longer need it. If I only remove it would it still be lingering in the background somewhere?

no: since it's refcounted as soon as it is removed from the parent
container it will be destroyed as well.

Then clutter_container_remove will do what I need.
in any case, destroying a texture should not segfault; it used to if you
had an ATI card and fglrx, which falsely advertised the ability to read
the pixels back and segafaulted inside the drivers. this has been fixed
(destroying textures will not cause reading the pixels back) in SVN.
My laptop has an ATI card -- maybe this is the issue. I could try SVN to see if the same thing happens.

Cheers,

Kevin
--
To unsubscribe send a mail to [EMAIL PROTECTED]

Reply via email to