randomgen / stinkee

Reverse-engineered C++ library to control Scentee diffusers.
MIT License
0 stars 2 forks source link

Terminate PortAudio only if initialization succeeded #5

Closed randomgen closed 9 years ago

randomgen commented 9 years ago

Failure to initialize PortAudio (stinkee::Device::init) is not correctly handled in the destructor: Pa_Terminate should be skipped.

Pa_Initialize function documentation (http://portaudio.com/docs/v19-doxydocs/portaudio_8h.html):

Note that if Pa_Initialize() returns an error code, Pa_Terminate() should NOT be called.

randomgen commented 9 years ago

f78d32d927263898890ebef5c5bdae92fd462535 Terminate PortAudio only if init succeeded