]> code.delx.au - pulseaudio/blobdiff - polyp/module-alsa-source.c
add refernce counting for sinks, sources, sink-inputs and source-outputs
[pulseaudio] / polyp / module-alsa-source.c
index 3ef54b17cf2c993829deeb1fe7381541f5860e7e..cf828eb0aeda85ce90921c418eee9470c3047e24 100644 (file)
@@ -232,8 +232,10 @@ void pa__done(struct pa_core *c, struct pa_module*m) {
     if (!(u = m->userdata))
         return;
     
-    if (u->source)
-        pa_source_free(u->source);
+    if (u->source) {
+        pa_source_disconnect(u->source);
+        pa_source_unref(u->source);
+    }
     
     if (u->io_events)
         pa_free_io_events(c->mainloop, u->io_events, u->n_io_events);