diff options
author | Max Kellermann <max@duempel.org> | 2014-01-07 23:33:46 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-07 23:35:18 +0100 |
commit | 27ca0db7a6143d2e479ff1ae52ec7c349ab1d4f2 (patch) | |
tree | 3f200069ab73baa09898fe1f242c6fd85396e2ba /src/Song.cxx | |
parent | 49f34fbf6861f10dbf9eb7549177888394926ff9 (diff) | |
download | mpd-27ca0db7a6143d2e479ff1ae52ec7c349ab1d4f2.tar.gz mpd-27ca0db7a6143d2e479ff1ae52ec7c349ab1d4f2.tar.xz mpd-27ca0db7a6143d2e479ff1ae52ec7c349ab1d4f2.zip |
util/Alloc: new library replacing GLib's g_malloc()
Diffstat (limited to 'src/Song.cxx')
-rw-r--r-- | src/Song.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Song.cxx b/src/Song.cxx index 6213d5e66..ae0c70ab9 100644 --- a/src/Song.cxx +++ b/src/Song.cxx @@ -21,11 +21,11 @@ #include "Song.hxx" #include "Directory.hxx" #include "tag/Tag.hxx" - -#include <glib.h> +#include "util/Alloc.hxx" #include <assert.h> #include <string.h> +#include <stdlib.h> Directory detached_root; @@ -39,7 +39,7 @@ song_alloc(const char *uri, Directory *parent) assert(uri_length); Song *song = (Song *) - g_malloc(sizeof(*song) - sizeof(song->uri) + uri_length + 1); + xalloc(sizeof(*song) - sizeof(song->uri) + uri_length + 1); song->tag = nullptr; memcpy(song->uri, uri, uri_length + 1); @@ -72,7 +72,7 @@ Song::ReplaceURI(const char *new_uri) new_song->mtime = mtime; new_song->start_ms = start_ms; new_song->end_ms = end_ms; - g_free(this); + free(this); return new_song; } @@ -106,7 +106,7 @@ void Song::Free() { delete tag; - g_free(this); + free(this); } void |