diff libinterp/dldfcn/audiodevinfo.cc @ 19614:478d35191196

maybe stop recorder in audio recorder destructor * audiodevinfo.cc (audiorecorder::~audiorecorder): Call stop if recorder is recording.
author John W. Eaton <jwe@octave.org>
date Thu, 15 Jan 2015 15:29:55 -0500
parents f64cdbe11621
children 6464cd19e0f4
line wrap: on
line diff
--- a/libinterp/dldfcn/audiodevinfo.cc	Wed Jan 14 21:46:13 2015 +0100
+++ b/libinterp/dldfcn/audiodevinfo.cc	Thu Jan 15 15:29:55 2015 -0500
@@ -1295,7 +1295,7 @@
 {
 public:
   audiorecorder (void);
-  ~audiorecorder (void) {};
+  ~audiorecorder (void);
 
   // Overloaded base functions
   double player_value (void) const { return 0; }
@@ -1539,6 +1539,15 @@
     left (), right (), stream (0), input_parameters (), type ()
 { }
 
+audiorecorder::~audiorecorder (void)
+{
+  if (isrecording ())
+    {
+      warning ("audiorecorder::~audiorecorder: Interrupting recording audiorecorder");
+      stop ();
+    }
+}
+
 void
 audiorecorder::print (std::ostream& os, bool pr_as_read_syntax) const
 {