diff options
author | Max Kellermann <max@duempel.org> | 2011-09-17 20:12:45 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-09-17 20:12:45 +0200 |
commit | c61a889c8633714e0f5aec83eb8917ef308db628 (patch) | |
tree | 88ef556e20be699fee88d0604708d67962934985 /src | |
parent | 567fe89a77410e805a567b20e4c9f7bf9720b950 (diff) | |
download | mpd-c61a889c8633714e0f5aec83eb8917ef308db628.tar.gz mpd-c61a889c8633714e0f5aec83eb8917ef308db628.tar.xz mpd-c61a889c8633714e0f5aec83eb8917ef308db628.zip |
output/roar: use GLib memory allocation functions
GLib has a built-in OOM handler.
Diffstat (limited to 'src')
-rw-r--r-- | src/output/roar_output_plugin.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/output/roar_output_plugin.c b/src/output/roar_output_plugin.c index b92efd4cb..2d1cb09c7 100644 --- a/src/output/roar_output_plugin.c +++ b/src/output/roar_output_plugin.c @@ -107,16 +107,8 @@ roar_init(G_GNUC_UNUSED const struct audio_format *audio_format, const struct config_param *param, G_GNUC_UNUSED GError **error) { - GMutex *lock = g_mutex_new(); - - roar_t * self = roar_mm_calloc(1, sizeof(*self)); - if (self == NULL) - { - g_set_error(error, roar_output_quark(), 0, "Failed to allocate memory"); - return NULL; - } - - self->lock = lock; + struct roar *self = g_new0(struct roar, 1); + self->lock = g_mutex_new(); self->err = ROAR_ERROR_NONE; roar_configure(self, param); return self; @@ -131,7 +123,7 @@ roar_finish(void *data) g_free(self->name); g_mutex_free(self->lock); - roar_mm_free(data); + g_free(self); } static bool |