1
0
Fork 0

Miscellaneous fixes under Steve's direction.

This commit is contained in:
curt 1998-09-29 02:00:38 +00:00
parent 62e85640da
commit 00fc8205da
2 changed files with 16 additions and 6 deletions

View file

@ -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 slSample ;
class slSamplePlayer ; class slSamplePlayer ;
class slEnvelope ; class slEnvelope ;
@ -165,9 +168,9 @@ public:
{ {
if ( ref_count != 0 ) if ( ref_count != 0 )
{ {
fprintf ( stderr, if ( __slPendingError == NULL )
"slSample: FATAL ERROR - Application deleted a sample while it was playing.\n" ) ; __slPendingError =
exit ( 1 ) ; "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, if ( __slPendingError == NULL )
"slEnvelope: FATAL ERROR - Application deleted an envelope while it was playing.\n" ) ; __slPendingError =
exit ( 1 ) ; "slXXXX: FATAL ERROR - Application deleted an envelope while it was playing.\n" ;
} }
delete time ; delete time ;

View file

@ -2,6 +2,7 @@
#include "sl.h" #include "sl.h"
slScheduler *slScheduler::current = NULL ; 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 () ) if ( not_working () )
return ; return ;
if ( __slPendingError != NULL )
{
fprintf ( stderr, __slPendingError ) ;
exit ( 1 ) ;
}
while ( secondsUsed() <= safety_margin ) while ( secondsUsed() <= safety_margin )
{ {
slSamplePlayer *psp [ 3 ] ; slSamplePlayer *psp [ 3 ] ;