diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp index 9481e2139e8..995d4c5f99e 100644 --- a/intern/audaspace/intern/AUD_C-API.cpp +++ b/intern/audaspace/intern/AUD_C-API.cpp @@ -77,6 +77,9 @@ int AUD_init(AUD_DeviceType device, AUD_Specs specs, int buffersize) #endif AUD_IDevice* dev = NULL; + if(AUD_device) + AUD_exit(); + try { switch(device) @@ -107,9 +110,6 @@ int AUD_init(AUD_DeviceType device, AUD_Specs specs, int buffersize) return false; } - if(AUD_device) - AUD_exit(); - AUD_device = dev; if(AUD_device->checkCapability(AUD_CAPS_3D_DEVICE)) AUD_3ddevice = dynamic_cast(AUD_device);