[pulseaudio-discuss] [PATCH] card-restore: save the database when shutting down

Tanu Kaskinen tanuk at iki.fi
Fri Mar 4 13:16:54 UTC 2016


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.
---
 src/modules/module-card-restore.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c
index f906843..2660a2b 100644
--- a/src/modules/module-card-restore.c
+++ b/src/modules/module-card-restore.c
@@ -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);
-- 
2.7.0



More information about the pulseaudio-discuss mailing list