From 00fc8205daa02e89488cfd7f025728ccf27f1203 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 29 Sep 1998 02:00:38 +0000 Subject: [PATCH] Miscellaneous fixes under Steve's direction. --- src/sl.h | 15 +++++++++------ src/slScheduler.cxx | 7 +++++++ 2 files changed, 16 insertions(+), 6 deletions(-) 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 ] ; -- 2.39.5