[waffle] [PATCH 0/3] Add the waffle_teardown API

Emil Velikov emil.l.velikov at gmail.com
Thu Jan 15 07:21:56 PST 2015


Hello all,

As mentioned a while back, here is the function waffle_teardown. Its purpose
is to cleanup the global state (the api_platform variable and the respective
platform private data).

This makes valgrind a bit happier (-20k of still reachable) and will allow
the user to use multiple platforms within a single application. For example

static const int32_t init_attribs_list[][] = {
 { WAFFLE_PLATFORM, WAFFLE_PLATFORM_GLX, 0 },
 { WAFFLE_PLATFORM, WAFFLE_PLATFORM_X11_EGL, 0 },
};

for (i = 0, i < ARRAYSIZE(init_attribs_list[]), i++) {
   waffle_init(WAFFLE_PLATFORM_GLX);
   ...
   waffle_teardown()
}



I'm not 100% happy with the function name - waffle_teardown, so if you have
any suggestions please put them forward.

This work has pointed out a bug (leak) in mesa's libGL/dri2 implementation,
which I'll send a patch for shortly.

The series can be found in my repo in the wip/waffle-teardown branch.

Cheers,
Emil



More information about the waffle mailing list