[pulseaudio-discuss] [PATCH 5/5] stream-restore: At startup, create dbus entries only for valid database entries.

Tanu Kaskinen ext-tanu.kaskinen at nokia.com
Thu Dec 3 05:34:26 PST 2009


---
 src/modules/module-stream-restore.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c
index a1273fe..becdb54 100644
--- a/src/modules/module-stream-restore.c
+++ b/src/modules/module-stream-restore.c
@@ -2044,14 +2044,19 @@ int pa__init(pa_module*m) {
         pa_datum next_key;
         char *name;
         struct dbus_entry *de;
+        struct entry *e;
 
         done = !pa_database_next(u->database, &key, &next_key, NULL);
 
         name = pa_xstrndup(key.data, key.size);
         pa_datum_free(&key);
 
-        de = dbus_entry_new(u, name);
-        pa_assert_se(pa_hashmap_put(u->dbus_entries, de->entry_name, de) == 0);
+        /* Use read_entry() for checking that the entry is valid. */
+        if ((e = read_entry(u, name))) {
+            de = dbus_entry_new(u, name);
+            pa_assert_se(pa_hashmap_put(u->dbus_entries, de->entry_name, de) == 0);
+            pa_xfree(e);
+        }
 
         pa_xfree(name);




More information about the pulseaudio-discuss mailing list