static void destroy(RomMapperNet* rm) { deviceCount--; if (rm->ym2151 != NULL) { ym2151Destroy(rm->ym2151); } if (rm->ym2148 != NULL) { ym2148Destroy(rm->ym2148); } if (rm->ykIo != NULL) { ykIoDestroy(rm->ykIo); } slotUnregister(rm->slot, rm->sslot, rm->startPage); debugDeviceUnregister(rm->debugHandle); deviceManagerUnregister(rm->deviceHandle); if (rm->romData != NULL) { free(rm->romData); } free(rm); }
void y8950Destroy(Y8950* y8950) { mixerUnregisterChannel(y8950->mixer, y8950->handle); boardTimerDestroy(y8950->timer1); boardTimerDestroy(y8950->timer2); OPLDestroy(y8950->opl); if (y8950->ykIo != NULL) { ykIoDestroy(y8950->ykIo); } free(y8950); }