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
e3c6ad51
Commit
e3c6ad51
authored
Jan 10, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event_pipe: remove the GLib source from the main context
Free memory before exiting.
parent
ca5432a7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
event_pipe.c
src/event_pipe.c
+5
-1
No files found.
src/event_pipe.c
View file @
e3c6ad51
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#endif
#endif
static
int
event_pipe
[
2
];
static
int
event_pipe
[
2
];
static
guint
event_pipe_source_id
;
static
GMutex
*
event_pipe_mutex
;
static
GMutex
*
event_pipe_mutex
;
static
bool
pipe_events
[
PIPE_EVENT_MAX
];
static
bool
pipe_events
[
PIPE_EVENT_MAX
];
static
event_pipe_callback_t
event_pipe_callbacks
[
PIPE_EVENT_MAX
];
static
event_pipe_callback_t
event_pipe_callbacks
[
PIPE_EVENT_MAX
];
...
@@ -92,7 +93,8 @@ void event_pipe_init(void)
...
@@ -92,7 +93,8 @@ void event_pipe_init(void)
g_error
(
"Couldn't set non-blocking I/O: %s"
,
strerror
(
errno
));
g_error
(
"Couldn't set non-blocking I/O: %s"
,
strerror
(
errno
));
channel
=
g_io_channel_unix_new
(
event_pipe
[
0
]);
channel
=
g_io_channel_unix_new
(
event_pipe
[
0
]);
g_io_add_watch
(
channel
,
G_IO_IN
,
main_notify_event
,
NULL
);
event_pipe_source_id
=
g_io_add_watch
(
channel
,
G_IO_IN
,
main_notify_event
,
NULL
);
g_io_channel_unref
(
channel
);
g_io_channel_unref
(
channel
);
event_pipe_mutex
=
g_mutex_new
();
event_pipe_mutex
=
g_mutex_new
();
...
@@ -102,6 +104,8 @@ void event_pipe_deinit(void)
...
@@ -102,6 +104,8 @@ void event_pipe_deinit(void)
{
{
g_mutex_free
(
event_pipe_mutex
);
g_mutex_free
(
event_pipe_mutex
);
g_source_remove
(
event_pipe_source_id
);
close
(
event_pipe
[
0
]);
close
(
event_pipe
[
0
]);
close
(
event_pipe
[
1
]);
close
(
event_pipe
[
1
]);
}
}
...
...
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