]> git.mxchange.org Git - simgear.git/blobdiff - src/sl.h
Cygnus tools compatibility tweaks.
[simgear.git] / src / sl.h
index 6e3fe6e0499c159ca92acaf0569587c2c2f019a7..5cbbc2adfba1ea31b0e8b20d8ad1c39d6d5999bd 100644 (file)
--- a/src/sl.h
+++ b/src/sl.h
@@ -30,6 +30,8 @@ class slEnvelope     ;
 class slScheduler    ;
 class slDSP          ;
 
+extern char *__slPendingError ;
+
 class slDSP
 {
 private:
@@ -109,6 +111,7 @@ public:
 
   void play ( void *buffer, size_t length ) { write ( buffer, length ) ; } 
 
+  int working () { return !error ; }
   int not_working () { return error ; }
 
   int getBps   () { return bps    ; }
@@ -163,12 +166,9 @@ public:
 
  ~slSample ()
   {
-    if ( ref_count != 0 )
-    {
-      fprintf ( stderr,
-        "slSample: FATAL ERROR - Application deleted a sample while it was playing.\n" ) ;
-      exit ( 1 ) ;
-    }
+    if ( ref_count != 0 && __slPendingError == NULL )
+      __slPendingError =
+        "slSample: FATAL ERROR - Application deleted a sample while it was playing.\n" ;
 
     delete buffer ;
   }
@@ -327,12 +327,9 @@ public:
  
  ~slEnvelope ()
   {
-    if ( ref_count != 0 )
-    {
-      fprintf ( stderr,
-        "slEnvelope: FATAL ERROR - Application deleted an envelope while it was playing.\n" ) ;
-      exit ( 1 ) ;
-    }
+    if ( ref_count != 0 && __slPendingError == NULL )
+      __slPendingError =
+      "slEnvelope: FATAL ERROR - Application deleted an envelope while it was playing.\n" ;
 
     delete time ;
     delete value ;