aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-09-23 08:19:00 -0700
committerChris Robinson <[email protected]>2009-09-23 08:19:00 -0700
commit55da339586e6792c3218eaff30ec827fadf1dcb4 (patch)
tree6fb37ae69e722c7070b2085f4cc5bc406b13105d
parent774eae0f2f4b20dcebb5a27ebc9b5351ed4b1365 (diff)
Properly clean up the pulse device
-rw-r--r--Alc/pulseaudio.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c
index ebdbd223..bec1c0a5 100644
--- a/Alc/pulseaudio.c
+++ b/Alc/pulseaudio.c
@@ -89,8 +89,6 @@ MAKE_FUNC(pa_threaded_mainloop_lock);
#endif
typedef struct {
- ALCdevice *device;
-
ALCuint samples;
ALCuint frame_size;
@@ -210,8 +208,6 @@ static ALCboolean pulse_open(ALCdevice *device, const ALCchar *device_name) //{{
{
pulse_data *data = ppa_xmalloc0(sizeof(pulse_data));
- data->device = device;
-
if(ppa_get_binary_name(data->path_name, sizeof(data->path_name)))
data->context_name = ppa_path_get_filename(data->path_name);
else
@@ -285,8 +281,6 @@ out:
ppa_threaded_mainloop_stop(data->loop);
ppa_threaded_mainloop_free(data->loop);
}
- device->ExtraData = NULL;
- device->szDeviceName = NULL;
ppa_xfree(data);
return ALC_FALSE;
@@ -313,6 +307,7 @@ static void pulse_close(ALCdevice *device) //{{{
ppa_threaded_mainloop_free(data->loop);
device->ExtraData = NULL;
+ free(device->szDeviceName);
device->szDeviceName = NULL;
DestroyRingBuffer(data->ring);
@@ -477,8 +472,6 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na
{
ppa_threaded_mainloop_unlock(data->loop);
pulse_close(device);
- free(device->szDeviceName);
- device->szDeviceName = NULL;
return ALC_FALSE;
}
@@ -507,8 +500,6 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na
AL_PRINT("Unknown format: 0x%x\n", device->Format);
ppa_threaded_mainloop_unlock(data->loop);
pulse_close(device);
- free(device->szDeviceName);
- device->szDeviceName = NULL;
return ALC_FALSE;
}
@@ -517,8 +508,6 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na
AL_PRINT("Invalid sample format\n");
ppa_threaded_mainloop_unlock(data->loop);
pulse_close(device);
- free(device->szDeviceName);
- device->szDeviceName = NULL;
return ALC_FALSE;
}
@@ -530,8 +519,6 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na
ppa_threaded_mainloop_unlock(data->loop);
pulse_close(device);
- free(device->szDeviceName);
- device->szDeviceName = NULL;
return ALC_FALSE;
}
@@ -547,8 +534,6 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na
data->stream = NULL;
pulse_close(device);
- free(device->szDeviceName);
- device->szDeviceName = NULL;
return ALC_FALSE;
}
@@ -564,8 +549,6 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na
data->stream = NULL;
pulse_close(device);
- free(device->szDeviceName);
- device->szDeviceName = NULL;
return ALC_FALSE;
}