aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/qsa.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/qsa.c
parent328fd7329d1ae1554452d2d4b0384173c0f47079 (diff)
Call the backend close method in the destructor
Diffstat (limited to 'Alc/backends/qsa.c')
-rw-r--r--Alc/backends/qsa.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/Alc/backends/qsa.c b/Alc/backends/qsa.c
index 58193c96..e1bbf2c2 100644
--- a/Alc/backends/qsa.c
+++ b/Alc/backends/qsa.c
@@ -166,7 +166,7 @@ typedef struct PlaybackWrapper {
} PlaybackWrapper;
static void PlaybackWrapper_Construct(PlaybackWrapper *self, ALCdevice *device);
-static DECLARE_FORWARD(PlaybackWrapper, ALCbackend, void, Destruct)
+static void PlaybackWrapper_Destruct(PlaybackWrapper *self);
static ALCenum PlaybackWrapper_open(PlaybackWrapper *self, const ALCchar *name);
static void PlaybackWrapper_close(PlaybackWrapper *self);
static ALCboolean PlaybackWrapper_reset(PlaybackWrapper *self);
@@ -624,6 +624,12 @@ static void PlaybackWrapper_Construct(PlaybackWrapper *self, ALCdevice *device)
self->ExtraData = NULL;
}
+static void PlaybackWrapper_Destruct(PlaybackWrapper *self)
+{
+ PlaybackWrapper_close(self);
+ ALCbackend_Destruct(STATIC_CAST(ALCbackend, self));
+}
+
static ALCenum PlaybackWrapper_open(PlaybackWrapper *self, const ALCchar *name)
{
return qsa_open_playback(self, name);
@@ -631,7 +637,8 @@ static ALCenum PlaybackWrapper_open(PlaybackWrapper *self, const ALCchar *name)
static void PlaybackWrapper_close(PlaybackWrapper *self)
{
- qsa_close_playback(self);
+ if(self->ExtraData)
+ qsa_close_playback(self);
}
static ALCboolean PlaybackWrapper_reset(PlaybackWrapper *self)
@@ -661,7 +668,7 @@ typedef struct CaptureWrapper {
} CaptureWrapper;
static void CaptureWrapper_Construct(CaptureWrapper *self, ALCdevice *device);
-static DECLARE_FORWARD(CaptureWrapper, ALCbackend, void, Destruct)
+static void CaptureWrapper_Destruct(CaptureWrapper *self);
static ALCenum CaptureWrapper_open(CaptureWrapper *self, const ALCchar *name);
static void CaptureWrapper_close(CaptureWrapper *self);
static DECLARE_FORWARD(CaptureWrapper, ALCbackend, ALCboolean, reset)
@@ -945,6 +952,12 @@ static void CaptureWrapper_Construct(CaptureWrapper *self, ALCdevice *device)
self->ExtraData = NULL;
}
+static void CaptureWrapper_Destruct(CaptureWrapper *self)
+{
+ CaptureWrapper_close(self);
+ ALCbackend_Destruct(STATIC_CAST(ALCbackend, self));
+}
+
static ALCenum CaptureWrapper_open(CaptureWrapper *self, const ALCchar *name)
{
return qsa_open_capture(self, name);
@@ -952,7 +965,8 @@ static ALCenum CaptureWrapper_open(CaptureWrapper *self, const ALCchar *name)
static void CaptureWrapper_close(CaptureWrapper *self)
{
- qsa_close_capture(self);
+ if(self->ExtraData)
+ qsa_close_capture(self);
}
static ALCboolean CaptureWrapper_start(CaptureWrapper *self)