Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
d67aa7c1
Commit
d67aa7c1
authored
Jan 03, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ClientNew: allocate/dispose client objects with new/delete
Prepare for adding non-trivial attributes.
parent
7a982169
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
ClientNew.cxx
src/ClientNew.cxx
+2
-3
No files found.
src/ClientNew.cxx
View file @
d67aa7c1
...
@@ -50,7 +50,6 @@ client_new(struct player_control *player_control,
...
@@ -50,7 +50,6 @@ client_new(struct player_control *player_control,
int
fd
,
const
struct
sockaddr
*
sa
,
size_t
sa_length
,
int
uid
)
int
fd
,
const
struct
sockaddr
*
sa
,
size_t
sa_length
,
int
uid
)
{
{
static
unsigned
int
next_client_num
;
static
unsigned
int
next_client_num
;
Client
*
client
;
char
*
remote
;
char
*
remote
;
assert
(
player_control
!=
NULL
);
assert
(
player_control
!=
NULL
);
...
@@ -87,7 +86,7 @@ client_new(struct player_control *player_control,
...
@@ -87,7 +86,7 @@ client_new(struct player_control *player_control,
return
;
return
;
}
}
client
=
g_new0
(
Client
,
1
);
Client
*
client
=
new
Client
(
);
client
->
player_control
=
player_control
;
client
->
player_control
=
player_control
;
client
->
channel
=
g_io_channel_new_socket
(
fd
);
client
->
channel
=
g_io_channel_new_socket
(
fd
);
...
@@ -163,5 +162,5 @@ client_close(Client *client)
...
@@ -163,5 +162,5 @@ client_close(Client *client)
g_log
(
G_LOG_DOMAIN
,
LOG_LEVEL_SECURE
,
g_log
(
G_LOG_DOMAIN
,
LOG_LEVEL_SECURE
,
"[%u] closed"
,
client
->
num
);
"[%u] closed"
,
client
->
num
);
g_free
(
client
)
;
delete
client
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment