From 17e44722194235b6dc28beaeea6923ac3d99f6a9 Mon Sep 17 00:00:00 2001 From: rbencina Date: Mon, 2 Apr 2012 07:58:04 +0000 Subject: [PATCH] zero asio host api rep immediately after init. prevents (unlikely) issue with trying to free uninited allocations if com init fails during Pa_Initialize() --- src/hostapi/asio/pa_asio.cpp | 2 ++ 1 file changed, 2 insertions(+) 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. -- 2.43.0