From: Hirotoshi YOSHITAKA Date: Mon, 6 Oct 2014 14:54:11 +0000 (+0900) Subject: Fix calloc-free mismatch X-Git-Url: https://main.carlh.net/gitweb/?p=rtaudio-cdist.git;a=commitdiff_plain;h=17188fb2b1f05d8bdee44fc9d5bc339da3e78912 Fix calloc-free mismatch Use free() for allocated memory by calloc (not delete). Deleting calloc-ed memory will become problem in the environment which overrides global "operator delete" like some game engine. --- diff --git a/RtAudio.cpp b/RtAudio.cpp index af7d205..9e1f1ba 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -3630,12 +3630,12 @@ public: outIndex_( 0 ) {} ~WasapiBuffer() { - delete buffer_; + free( buffer_ ); } // sets the length of the internal ring buffer void setBufferSize( unsigned int bufferSize, unsigned int formatBytes ) { - delete buffer_; + free( buffer_ ); buffer_ = ( char* ) calloc( bufferSize, formatBytes );