From: rbencina Date: Mon, 2 Apr 2012 07:58:04 +0000 (+0000) Subject: zero asio host api rep immediately after init. prevents (unlikely) issue with trying... X-Git-Tag: pa_stable_v19_20140130_r1919~75 X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=17e44722194235b6dc28beaeea6923ac3d99f6a9;p=portaudio zero asio host api rep immediately after init. prevents (unlikely) issue with trying to free uninited allocations if com init fails during Pa_Initialize() --- diff --git a/src/hostapi/asio/pa_asio.cpp b/src/hostapi/asio/pa_asio.cpp index 72e8d1b..b2528b0 100644 --- a/src/hostapi/asio/pa_asio.cpp +++ b/src/hostapi/asio/pa_asio.cpp @@ -1038,6 +1038,8 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex goto error; } + memset( asioHostApi, 0, sizeof(PaAsioHostApiRepresentation) ); /* ensure all fields are zeroed. especially asioHostApi->allocations */ + /* We initialize COM ourselves here and uninitialize it in Terminate(). This should be the only COM initialization needed in this module.