diff --git a/main b/main index 6954eb3..828f799 100755 Binary files a/main and b/main differ diff --git a/main.c b/main.c index 6e21385..d44cff4 100644 --- a/main.c +++ b/main.c @@ -109,6 +109,7 @@ struct MsgPort *timerPort; APTR bellSound = NULL; struct Library *DataTypesBase; +BYTE waitForSoundSignalNumber; // our business logic // for how long should I cook this pizza? @@ -182,6 +183,8 @@ int setup(void) { if (NULL == (DataTypesBase = OpenLibrary("datatypes.library", 40))) { // this is ok, we just won't play sound printf("no sound!"); + } else { + waitForSoundSignalNumber = AllocSignal(-1); } return 1; @@ -194,6 +197,7 @@ void teardown(void) { // http://amigadev.elowar.com/read/ADCD_2.1/Devices_Manual_guide/node0196.html if (DataTypesBase) { CloseLibrary(DataTypesBase); + FreeSignal(waitForSoundSignalNumber); } if (TimerIO) { CloseDevice((struct IORequest *)TimerIO); @@ -708,7 +712,6 @@ void handleIntuitionMessage(struct IntuiMessage *iMessage) { } } -BYTE waitForSoundSignalNumber; /** * Start playing a bell sound, then wait for it to finish. @@ -717,8 +720,8 @@ void startBellSound(void) { struct dtTrigger myTrigger; ULONG soundPlayResult; + if (!DataTypesBase) return; // https://amigaworld.net/modules/newbb/viewtopic.php?forum=15&topic_id=39094&post_id=735120&viewmode=thread&order=0#735120 - waitForSoundSignalNumber = AllocSignal(-1); if (bellSound = NewDTObject( BELL_FILENAME,