Open madebr opened 1 year ago
In S3Shutdown, the descriptors are cleaned up with the following code: https://github.com/dethrace-labs/dethrace/blob/07d517307a2be88e086f8b94d53327072b8cf50d/src/S3/audio.c#L103-L113
S3Shutdown
However, S3Disable disables gS3_enabled: https://github.com/dethrace-labs/dethrace/blob/07d517307a2be88e086f8b94d53327072b8cf50d/src/S3/audio.c#L124-L126
S3Disable
gS3_enabled
Which causes S3DisposeDescriptor to never do anything: https://github.com/dethrace-labs/dethrace/blob/07d517307a2be88e086f8b94d53327072b8cf50d/src/S3/audio.c#L193-L200
S3DisposeDescriptor
Applying the following patch to disable S3 after disposal of all descriptors causes infinite recursion: (the patch is also incorrect, becuase S3Disable stops all outlet sounds before descriptors are destroyed)
--- a/src/S3/audio.c +++ b/src/S3/audio.c @@ -100,7 +100,9 @@ void S3Shutdown(void) { S3DisableMIDI(); S3DisableCDA(); if (gS3_enabled) { +#if !defined(DETHRACE_FIX_BUGS) S3Disable(); +#endif for (descriptor = gS3_descriptors; descriptor != NULL; descriptor = next_descriptor) { next_descriptor = descriptor->next; S3DisposeDescriptor(descriptor->id); @@ -111,6 +113,9 @@ void S3Shutdown(void) { S3DisposeOutlet(outlet); } S3DisposeUnboundChannels(); +#if defined(DETHRACE_FIX_BUGS) + S3Disable(); +#endif } if (gS3_opened_output_devices) { S3CloseDevices();
In
S3Shutdown
, the descriptors are cleaned up with the following code: https://github.com/dethrace-labs/dethrace/blob/07d517307a2be88e086f8b94d53327072b8cf50d/src/S3/audio.c#L103-L113However,
S3Disable
disablesgS3_enabled
: https://github.com/dethrace-labs/dethrace/blob/07d517307a2be88e086f8b94d53327072b8cf50d/src/S3/audio.c#L124-L126Which causes
S3DisposeDescriptor
to never do anything: https://github.com/dethrace-labs/dethrace/blob/07d517307a2be88e086f8b94d53327072b8cf50d/src/S3/audio.c#L193-L200Applying the following patch to disable S3 after disposal of all descriptors causes infinite recursion: (the patch is also incorrect, becuase
S3Disable
stops all outlet sounds before descriptors are destroyed)