mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
don't hit an assert in the client if posix shm is not available
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1376 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
ead67cda48
commit
40ecf869d0
1 changed files with 14 additions and 2 deletions
|
|
@ -98,6 +98,8 @@ static void unlock_autospawn_lock_file(pa_context *c) {
|
|||
}
|
||||
}
|
||||
|
||||
static void context_free(pa_context *c);
|
||||
|
||||
pa_context *pa_context_new(pa_mainloop_api *mainloop, const char *name) {
|
||||
pa_context *c;
|
||||
|
||||
|
|
@ -148,7 +150,16 @@ pa_context *pa_context_new(pa_mainloop_api *mainloop, const char *name) {
|
|||
#endif
|
||||
pa_client_conf_env(c->conf);
|
||||
|
||||
c->mempool = pa_mempool_new(!c->conf->disable_shm);
|
||||
if (!(c->mempool = pa_mempool_new(!c->conf->disable_shm))) {
|
||||
|
||||
if (!c->conf->disable_shm)
|
||||
c->mempool = pa_mempool_new(0);
|
||||
|
||||
if (!c->mempool) {
|
||||
context_free(c);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
|
@ -178,7 +189,8 @@ static void context_free(pa_context *c) {
|
|||
if (c->playback_streams)
|
||||
pa_dynarray_free(c->playback_streams, NULL, NULL);
|
||||
|
||||
pa_mempool_free(c->mempool);
|
||||
if (c->mempool)
|
||||
pa_mempool_free(c->mempool);
|
||||
|
||||
if (c->conf)
|
||||
pa_client_conf_free(c->conf);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue