diff options
author | Max Kellermann <max@duempel.org> | 2013-01-03 17:26:40 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-03 17:47:39 +0100 |
commit | d67aa7c19dfaf5c39b49dc8dfc486b4e99f31db1 (patch) | |
tree | 51096a16857c54942d302671388879904e19cd8c /src/ClientNew.cxx | |
parent | 7a982169c9dc3a673e922e7f3b9b73368cef0aae (diff) | |
download | mpd-d67aa7c19dfaf5c39b49dc8dfc486b4e99f31db1.tar.gz mpd-d67aa7c19dfaf5c39b49dc8dfc486b4e99f31db1.tar.xz mpd-d67aa7c19dfaf5c39b49dc8dfc486b4e99f31db1.zip |
ClientNew: allocate/dispose client objects with new/delete
Prepare for adding non-trivial attributes.
Diffstat (limited to '')
-rw-r--r-- | src/ClientNew.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ClientNew.cxx b/src/ClientNew.cxx index 5830a728e..34e782bd2 100644 --- a/src/ClientNew.cxx +++ b/src/ClientNew.cxx @@ -50,7 +50,6 @@ client_new(struct player_control *player_control, int fd, const struct sockaddr *sa, size_t sa_length, int uid) { static unsigned int next_client_num; - Client *client; char *remote; assert(player_control != NULL); @@ -87,7 +86,7 @@ client_new(struct player_control *player_control, return; } - client = g_new0(Client, 1); + Client *client = new Client(); client->player_control = player_control; client->channel = g_io_channel_new_socket(fd); @@ -163,5 +162,5 @@ client_close(Client *client) g_log(G_LOG_DOMAIN, LOG_LEVEL_SECURE, "[%u] closed", client->num); - g_free(client); + delete client; } |