device-restore: Sync the database on unload
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Sun, 17 Aug 2014 10:43:53 +0000 (13:43 +0300)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Mon, 18 Aug 2014 10:52:11 +0000 (13:52 +0300)
If there are unsaved changes, those need to be written to disk before
the module is unloaded, otherwise the changes are lost.

src/modules/module-device-restore.c

index 031a62bb50cb51b357066900449424c3c29309d8..b7f172fc686c2ee42198372c76d22e1f898e7d7f 100644 (file)
@@ -1321,8 +1321,10 @@ void pa__done(pa_module*m) {
     if (u->connection_unlink_hook_slot)
         pa_hook_slot_free(u->connection_unlink_hook_slot);
 
-    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);