card-restore: save the database when shutting down

If u->save_time_event is non-NULL when the module is being unloaded,
it means that there are some changes to the database that haven't
yet been flushed to the disk.

Acked-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
Tanu Kaskinen 2016-03-04 15:16:54 +02:00
parent c87917cf0d
commit ff85bc437c

View file

@ -608,8 +608,10 @@ void pa__done(pa_module*m) {
if (!(u = m->userdata))
return;
if (u->save_time_event)
if (u->save_time_event) {
u->core->mainloop->time_free(u->save_time_event);
pa_database_sync(u->database);
}
if (u->database)
pa_database_close(u->database);