Skip to content

Commit

Permalink
Forgot error check after Pa_OpenStream. Naughty.
Browse files Browse the repository at this point in the history
git-svn-id: https://subversion.assembla.com/svn/portaudio/portaudio/trunk@1841 0f58301d-fd10-0410-b4af-bbb618454e57
  • Loading branch information
robiwano committed Jun 19, 2012
1 parent 8bafb71 commit 5a1dc1f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/paex_sine_c++.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ class Sine
this /* Using 'this' for userData so we can cast to Sine* in paCallback method */
);

if (err != paNoError)
{
/* Failed to open stream to device !!! */
return false;
}

err = Pa_SetStreamFinishedCallback( stream, &Sine::paStreamFinished );

if (err != paNoError)
Expand Down Expand Up @@ -121,13 +127,19 @@ class Sine

bool start()
{
if (stream == 0)
return false;

PaError err = Pa_StartStream( stream );

return (err == paNoError);
}

bool stop()
{
if (stream == 0)
return false;

PaError err = Pa_StopStream( stream );

return (err == paNoError);
Expand Down

0 comments on commit 5a1dc1f

Please sign in to comment.