]> git.mxchange.org Git - simgear.git/commitdiff
Miscellaneous fixes under Steve's direction.
authorcurt <curt>
Tue, 29 Sep 1998 02:00:38 +0000 (02:00 +0000)
committercurt <curt>
Tue, 29 Sep 1998 02:00:38 +0000 (02:00 +0000)
src/sl.h
src/slScheduler.cxx

index 6e3fe6e0499c159ca92acaf0569587c2c2f019a7..ab141bd74af2cd25dcedb0710d86519077b26831 100644 (file)
--- a/src/sl.h
+++ b/src/sl.h
@@ -24,6 +24,9 @@ typedef unsigned short Ushort ;
 
 #define SL_DEFAULT_SAMPLING_RATE 11025
 
 
 #define SL_DEFAULT_SAMPLING_RATE 11025
 
+/* Set if the next slScheduler::update will die */
+extern char *__slPendingError ;
+
 class slSample       ;
 class slSamplePlayer ;
 class slEnvelope     ;
 class slSample       ;
 class slSamplePlayer ;
 class slEnvelope     ;
@@ -165,9 +168,9 @@ public:
   {
     if ( ref_count != 0 )
     {
   {
     if ( ref_count != 0 )
     {
-      fprintf ( stderr,
-        "slSample: FATAL ERROR - Application deleted a sample while it was playing.\n" ) ;
-      exit ( 1 ) ;
+    if ( __slPendingError == NULL )
+      __slPendingError =
+            "slXXXX: FATAL ERROR - Application deleted a sample while it was playing.\n" ;
     }
 
     delete buffer ;
     }
 
     delete buffer ;
@@ -329,9 +332,9 @@ public:
   {
     if ( ref_count != 0 )
     {
   {
     if ( ref_count != 0 )
     {
-      fprintf ( stderr,
-        "slEnvelope: FATAL ERROR - Application deleted an envelope while it was playing.\n" ) ;
-      exit ( 1 ) ;
+    if ( __slPendingError == NULL )
+      __slPendingError =
+            "slXXXX: FATAL ERROR - Application deleted an envelope while it was playing.\n" ;
     }
 
     delete time ;
     }
 
     delete time ;
index d0b4f5b1027beb3f6580d6733541a44d3b0c340f..dd29a789612aa9ece6a89071d6db6cb047b6b6f4 100644 (file)
@@ -2,6 +2,7 @@
 #include "sl.h"
 
 slScheduler *slScheduler::current = NULL ;
 #include "sl.h"
 
 slScheduler *slScheduler::current = NULL ;
+char *__slPendingError = NULL ;
 
 void slScheduler::init ()
 {
 
 void slScheduler::init ()
 {
@@ -122,6 +123,12 @@ void slScheduler::realUpdate ( int dump_first )
   if ( not_working () )
     return ;
 
   if ( not_working () )
     return ;
 
+  if ( __slPendingError != NULL )
+  {
+      fprintf ( stderr, __slPendingError ) ;
+      exit ( 1 ) ;
+  }
+
   while ( secondsUsed() <= safety_margin )
   {
     slSamplePlayer *psp [ 3 ] ;
   while ( secondsUsed() <= safety_margin )
   {
     slSamplePlayer *psp [ 3 ] ;