pipewire: improve pw_init/pw_deinit

Keep a counter for the amount of times pw_init() was called and
only clear everything when pw_deinit() was called an equal amount of
times.
Also ensure that pw_init() can be called again after pw_deinit().

Fixes #2238
This commit is contained in:
Wim Taymans 2022-03-26 21:20:07 +01:00
parent 34380ff02e
commit b225fe1d54
2 changed files with 21 additions and 3 deletions

View file

@ -49,9 +49,21 @@ PWTEST(library_version)
return PWTEST_PASS;
}
PWTEST(init_deinit)
{
pw_init(0, NULL);
pw_deinit();
pw_init(0, NULL);
pw_init(0, NULL);
pw_deinit();
pw_deinit();
return PWTEST_PASS;
}
PWTEST_SUITE(properties)
{
pwtest_add(library_version, PWTEST_NOARG);
pwtest_add(init_deinit, PWTEST_NOARG);
return PWTEST_PASS;
}