mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
introduce pa_xmalloc() and friends
implement module auto loading git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@103 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
24291aff27
commit
46091a9237
61 changed files with 700 additions and 631 deletions
|
|
@ -41,6 +41,7 @@
|
|||
#include "namereg.h"
|
||||
#include "clitext.h"
|
||||
#include "cli-command.h"
|
||||
#include "xmalloc.h"
|
||||
|
||||
struct pa_cli {
|
||||
struct pa_core *core;
|
||||
|
|
@ -65,8 +66,7 @@ struct pa_cli* pa_cli_new(struct pa_core *core, struct pa_iochannel *io, struct
|
|||
struct pa_cli *c;
|
||||
assert(io);
|
||||
|
||||
c = malloc(sizeof(struct pa_cli));
|
||||
assert(c);
|
||||
c = pa_xmalloc(sizeof(struct pa_cli));
|
||||
c->core = core;
|
||||
c->line = pa_ioline_new(io);
|
||||
assert(c->line);
|
||||
|
|
@ -95,7 +95,7 @@ void pa_cli_free(struct pa_cli *c) {
|
|||
assert(c);
|
||||
pa_ioline_free(c->line);
|
||||
pa_client_free(c->client);
|
||||
free(c);
|
||||
pa_xfree(c);
|
||||
}
|
||||
|
||||
static void client_kill(struct pa_client *client) {
|
||||
|
|
@ -132,7 +132,7 @@ static void line_callback(struct pa_ioline *line, const char *s, void *userdata)
|
|||
pa_cli_command_execute_line(c->core, s, buf, &c->fail, &c->verbose);
|
||||
c->defer_kill--;
|
||||
pa_ioline_puts(line, p = pa_strbuf_tostring_free(buf));
|
||||
free(p);
|
||||
pa_xfree(p);
|
||||
|
||||
if (c->kill_requested) {
|
||||
if (c->eof_callback)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue