aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/sndio.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-01-28 23:32:28 -0800
committerChris Robinson <[email protected]>2018-01-28 23:32:28 -0800
commita042dbf30524429b49adb63efda35f53054ae924 (patch)
tree6e905d8173f2db6dd41b2e9cb471a9c860c54279 /Alc/backends/sndio.c
parent328fd7329d1ae1554452d2d4b0384173c0f47079 (diff)
Call the backend close method in the destructor
Diffstat (limited to 'Alc/backends/sndio.c')
-rw-r--r--Alc/backends/sndio.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Alc/backends/sndio.c b/Alc/backends/sndio.c
index 47e05353..436baf26 100644
--- a/Alc/backends/sndio.c
+++ b/Alc/backends/sndio.c
@@ -77,9 +77,7 @@ static void ALCsndioBackend_Construct(ALCsndioBackend *self, ALCdevice *device)
static void ALCsndioBackend_Destruct(ALCsndioBackend *self)
{
- if(self->sndHandle)
- sio_close(self->sndHandle);
- self->sndHandle = NULL;
+ ALCsndioBackend_close(self);
al_free(self->mix_data);
self->mix_data = NULL;
@@ -152,7 +150,8 @@ static ALCenum ALCsndioBackend_open(ALCsndioBackend *self, const ALCchar *name)
static void ALCsndioBackend_close(ALCsndioBackend *self)
{
- sio_close(self->sndHandle);
+ if(self->sndHandle)
+ sio_close(self->sndHandle);
self->sndHandle = NULL;
}