Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler_dsp.cc')
-rw-r--r--winsup/cygwin/fhandler_dsp.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/winsup/cygwin/fhandler_dsp.cc b/winsup/cygwin/fhandler_dsp.cc
index a2ddef4f2..a872c231e 100644
--- a/winsup/cygwin/fhandler_dsp.cc
+++ b/winsup/cygwin/fhandler_dsp.cc
@@ -457,12 +457,12 @@ fhandler_dev_dsp::Audio_out::stop (bool immediately)
debug_printf ("waveOutClose rc=%d", rc);
clearOwner ();
+ }
- if (bigwavebuffer_)
- {
- delete[] bigwavebuffer_;
- bigwavebuffer_ = NULL;
- }
+ if (bigwavebuffer_)
+ {
+ delete[] bigwavebuffer_;
+ bigwavebuffer_ = NULL;
}
}
@@ -859,12 +859,12 @@ fhandler_dev_dsp::Audio_in::stop ()
debug_printf ("waveInClose rc=%d", rc);
clearOwner ();
+ }
- if (bigwavebuffer_)
- {
- delete[] bigwavebuffer_;
- bigwavebuffer_ = NULL;
- }
+ if (bigwavebuffer_)
+ {
+ delete[] bigwavebuffer_;
+ bigwavebuffer_ = NULL;
}
}
@@ -1207,6 +1207,11 @@ fhandler_dev_dsp::close (void)
}
if (audio_out_)
{
+ if (exit_state != ES_NOT_EXITING)
+ { // emergency close due to call to exit() or Ctrl-C:
+ // do not wait for all pending audio to be played
+ audio_out_->stop (true);
+ }
delete audio_out_;
audio_out_ = NULL;
}