Fall back to creating a "normal" memory pool if unable to get a shared one.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1321 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Pierre Ossman 2006-08-22 12:51:29 +00:00
parent 26bfce6281
commit 7bf2540778

View file

@ -49,11 +49,20 @@ pa_core* pa_core_new(pa_mainloop_api *m, int shared) {
pa_core* c;
pa_mempool *pool;
if (!(pool = pa_mempool_new(shared))) {
pa_log("pa_mempool_new() failed.");
return NULL;
if (shared) {
if (!(pool = pa_mempool_new(shared))) {
pa_log_warn("failed to allocate shared memory pool. Falling back to a normal memory pool.");
shared = 0;
}
}
if (!shared) {
if (!(pool = pa_mempool_new(shared))) {
pa_log("pa_mempool_new() failed.");
return NULL;
}
}
c = pa_xnew(pa_core, 1);
c->mainloop = m;