On Wed, 14 Nov 2012, Carlos R. Mafra escribió:

> On Wed, 14 Nov 2012 at 19:34:42 +0100, Rodolfo García Peñas wrote:
> > Ok,
> > 
> > seems to be ok now :-)
> > 
> > --- a/src/icon.c
> > +++ b/src/icon.c
> > @@ -778,8 +778,10 @@ static int get_rimage_icon_from_wm_hints(WIcon *icon)
> >         /* Resize the icon to the wPreferences.icon_size size */
> >         image = wIconValidateIconSize(image, wPreferences.icon_size);
> >  
> > -       /* FIXME: If unset_icon_image, pointer double free then crash 
> > -       unset_icon_image(icon); */
> > +       unset_icon_image(icon);
> > +
> > +       /* Set the new info */
> > +       icon->file = NULL;
> >         icon->file_image = image;
> 
> But why setting icon->file to NULL helps? What goes wrong otherwise?

Really I don't have idea, but now is fine. Problem in wfree()?

See that wfree sets it to NULL. Needs the "if (ptr)" a bracket?


void wfree(void *ptr)
{
        if (ptr)
#ifdef USE_BOEHM_GC
                /* This should eventually be removed, once the criss-cross
                 * of wmalloc()d memory being free()d, malloc()d memory being
                 * wfree()d, various misuses of calling wfree() on objects
                 * allocated by libc malloc() and calling libc free() on
                 * objects allocated by Boehm GC (think external libraries)
                 * is cleaned up.
                 */
                if (GC_base(ptr) != 0)
                        GC_FREE(ptr);
                else
                        free(ptr);
#else
                free(ptr);
#endif
        ptr = NULL;
}


-- 
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/


-- 
To unsubscribe, send mail to [email protected].

Reply via email to