card-restore: save the database when shutting down
authorTanu Kaskinen <tanuk@iki.fi>
Fri, 4 Mar 2016 13:16:54 +0000 (15:16 +0200)
committerTanu Kaskinen <tanuk@iki.fi>
Tue, 8 Mar 2016 08:21:13 +0000 (10:21 +0200)
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>
src/modules/module-card-restore.c

index f906843..2660a2b 100644 (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);