From c17545108b33162fb186f797b8a408511e9252f4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 15 Aug 2004 00:02:26 +0000 Subject: proper ref counting for more objects some documentation update git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@124 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/polyplib-context.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'polyp/polyplib-context.c') diff --git a/polyp/polyplib-context.c b/polyp/polyplib-context.c index 5f849e24..2a0c24a5 100644 --- a/polyp/polyplib-context.c +++ b/polyp/polyplib-context.c @@ -92,11 +92,13 @@ static void context_free(struct pa_context *c) { pa_stream_set_state(c->streams, PA_STREAM_TERMINATED); if (c->client) - pa_socket_client_free(c->client); + pa_socket_client_unref(c->client); if (c->pdispatch) - pa_pdispatch_free(c->pdispatch); - if (c->pstream) - pa_pstream_free(c->pstream); + pa_pdispatch_unref(c->pdispatch); + if (c->pstream) { + pa_pstream_close(c->pstream); + pa_pstream_unref(c->pstream); + } if (c->record_streams) pa_dynarray_free(c->record_streams, NULL, NULL); @@ -140,15 +142,17 @@ void pa_context_set_state(struct pa_context *c, enum pa_context_state st) { } if (c->pdispatch) - pa_pdispatch_free(c->pdispatch); + pa_pdispatch_unref(c->pdispatch); c->pdispatch = NULL; - if (c->pstream) - pa_pstream_free(c->pstream); + if (c->pstream) { + pa_pstream_close(c->pstream); + pa_pstream_unref(c->pstream); + } c->pstream = NULL; if (c->client) - pa_socket_client_free(c->client); + pa_socket_client_unref(c->client); c->client = NULL; } @@ -267,7 +271,7 @@ static void on_connection(struct pa_socket_client *client, struct pa_iochannel*i pa_context_ref(c); - pa_socket_client_free(client); + pa_socket_client_unref(client); c->client = NULL; if (!io) { -- cgit