libpulse: Store pa_stream pointers to hashmaps instead of dynarrays.

Since the stream identifiers (channels) are monotonically growing integer, it
isn't a good idea to use them as index to a dynamic array, because the array
will grow all the time. This is not a problem with client connections that
don't create many streams, but, for example, long-running clients that use
libcanberra for playing event sounds, this means that the client connection
effectively leaks memory.
This commit is contained in:
Tanu Kaskinen 2009-12-03 13:22:05 +02:00 committed by Colin Guthrie
parent 118466638a
commit 4c793cfc76
3 changed files with 17 additions and 18 deletions

View file

@ -34,7 +34,6 @@
#include <pulsecore/socket-client.h>
#include <pulsecore/pstream.h>
#include <pulsecore/pdispatch.h>
#include <pulsecore/dynarray.h>
#include <pulsecore/llist.h>
#include <pulsecore/native-common.h>
#include <pulsecore/strlist.h>
@ -66,7 +65,7 @@ struct pa_context {
pa_pstream *pstream;
pa_pdispatch *pdispatch;
pa_dynarray *record_streams, *playback_streams;
pa_hashmap *record_streams, *playback_streams;
PA_LLIST_HEAD(pa_stream, streams);
PA_LLIST_HEAD(pa_operation, operations);