Browse Source

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.
tags/4.1.2
Hirotoshi YOSHITAKA 11 years ago
parent
commit
17188fb2b1
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      RtAudio.cpp

+ 2
- 2
RtAudio.cpp View File

@@ -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 );


Loading…
Cancel
Save