On 24 March 2015 at 17:37, Jose Fonseca <[email protected]> wrote:
> Is wcore_display_teardown called only once, or when destroying each display?
>
> If the latter, then it's not safe to call `mtx_destroy(&mutex)` on
> `wcore_display_teardown`.  Otherwise when  wcore_display_init is called
> next, wcore_display_init_once() will not be called a 2nd time, hence mutex
> will stay invalid.
>
>
> This should probably done at waffle_teardown.
>
> BTW, if the mutex was initialized at waffle_init, then once_flag wouldn't
> even be necessary.
>
Indeed you're bang on the spot. id_counter should be locked throughout
a series of display_{connect, disconnect}, thus we should push
mtx_{init,destroy} up to waffle_{init,teardown}. What worries me is
that none of the tests (ran in valgrind) point out any issues.

Might be worth looking into, once I've got waffle_teardown() hooked in there.

-Emil
_______________________________________________
waffle mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/waffle

Reply via email to