// It should not be possible to get here because the preprocessor\r
// definition __RTAUDIO_DUMMY__ is automatically defined if no\r
// API-specific definitions are passed to the compiler. But just in\r
- // case something weird happens, we'll print out an error message.\r
+ // case something weird happens, we'll thow an error.\r
std::string errorText = "\nRtAudio: no compiled API support found ... critical error!!\n\n";\r
throw( RtAudioError( errorText, RtAudioError::UNSPECIFIED ) );\r
}\r
\r
RtAudio :: ~RtAudio() throw()\r
{\r
- delete rtapi_;\r
+ if ( rtapi_ )\r
+ delete rtapi_;\r
}\r
\r
void RtAudio :: openStream( RtAudio::StreamParameters *outputParameters,\r
stream_.state = STREAM_RUNNING;\r
\r
unlock:\r
- apiInfo->runnable = false; // fixes high CPU usage when stopped\r
pthread_cond_signal( &apiInfo->runnable_cv );\r
MUTEX_UNLOCK( &stream_.mutex );\r
\r
}\r
\r
unlock:\r
+ apiInfo->runnable = false; // fixes high CPU usage when stopped\r
MUTEX_UNLOCK( &stream_.mutex );\r
\r
if ( result >= 0 ) return;\r
stream_.nUserChannels[mode] = channels;\r
stream_.nDeviceChannels[mode] = channels + firstChannel;\r
stream_.channelOffset[mode] = 0;\r
+ std::string streamName = "RtAudio";\r
\r
// Allocate necessary internal buffers.\r
bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat );\r
pah = static_cast<PulseAudioHandle *>( stream_.apiHandle );\r
\r
int error;\r
- std::string streamName = "RtAudio";\r
if ( !options->streamName.empty() ) streamName = options->streamName;\r
switch ( mode ) {\r
case INPUT:\r