From: curt Date: Tue, 29 Sep 1998 02:00:38 +0000 (+0000) Subject: Miscellaneous fixes under Steve's direction. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=00fc8205daa02e89488cfd7f025728ccf27f1203;p=simgear.git Miscellaneous fixes under Steve's direction. --- diff --git a/src/sl.h b/src/sl.h index 6e3fe6e0..ab141bd7 100644 --- a/src/sl.h +++ b/src/sl.h @@ -24,6 +24,9 @@ typedef unsigned short Ushort ; #define SL_DEFAULT_SAMPLING_RATE 11025 +/* Set if the next slScheduler::update will die */ +extern char *__slPendingError ; + class slSample ; class slSamplePlayer ; class slEnvelope ; @@ -165,9 +168,9 @@ public: { 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 ; @@ -329,9 +332,9 @@ public: { 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 ; diff --git a/src/slScheduler.cxx b/src/slScheduler.cxx index d0b4f5b1..dd29a789 100644 --- a/src/slScheduler.cxx +++ b/src/slScheduler.cxx @@ -2,6 +2,7 @@ #include "sl.h" slScheduler *slScheduler::current = NULL ; +char *__slPendingError = NULL ; void slScheduler::init () { @@ -122,6 +123,12 @@ void slScheduler::realUpdate ( int dump_first ) if ( not_working () ) return ; + if ( __slPendingError != NULL ) + { + fprintf ( stderr, __slPendingError ) ; + exit ( 1 ) ; + } + while ( secondsUsed() <= safety_margin ) { slSamplePlayer *psp [ 3 ] ;