[PATCH weston] compositor: fix crash when destroying incompletely created output

Derek Foreman derekf at osg.samsung.com
Thu Aug 6 17:11:02 PDT 2015

On 06/08/15 07:12 PM, Dawid Gajownik wrote:
> On Wed, Aug 5, 2015 at 6:20 PM, Derek Foreman <derekf at osg.samsung.com> wrote:
>> Good catch!
>> However, can we get the same result by making weston_output_init() call
>> wl_list_init(&output->link)?
>> I think that'd be simple enough not to require a comment to explain
>> what's going on...
> Indeed, you're right. I tested your approach and it works as expected.
> I thought that wl_list_init() should be run only on a list head, not
> individual items, but I see that I was wrong :)

There's a caveat though - you have to be careful to never run it on an
item that's actually in a list at the time or it'll put a loop in the
list! :)

> Thanks,
>      Dawid

More information about the wayland-devel mailing list