card: don't allow the CARD_NEW hook to fail
authorTanu Kaskinen <tanuk@iki.fi>
Tue, 7 Jun 2016 13:51:00 +0000 (16:51 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Tue, 28 Jun 2016 13:55:42 +0000 (16:55 +0300)
There is currently no use for allowing modules to cancel card creation,
and I don't see need for that in the future either. Let's simplify
things by removing the failure handling code.

src/pulsecore/card.c

index 410746b..0ac70b9 100644 (file)
@@ -149,12 +149,7 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
     }
 
     pa_card_new_data_set_name(data, name);
-
-    if (pa_hook_fire(&core->hooks[PA_CORE_HOOK_CARD_NEW], data) < 0) {
-        pa_xfree(c);
-        pa_namereg_unregister(core, name);
-        return NULL;
-    }
+    pa_hook_fire(&core->hooks[PA_CORE_HOOK_CARD_NEW], data);
 
     c->core = core;
     c->name = pa_xstrdup(data->name);