use g_free() instead of free()

On some platforms, g_free() must be used for memory allocated by
GLib.  This patch intends to correct a lot of occurrences, but is
probably not complete.
This commit is contained in:
Max Kellermann
2009-01-25 18:47:21 +01:00
parent 7960ad32fc
commit a45922cd66
18 changed files with 36 additions and 40 deletions

View File

@@ -97,7 +97,7 @@ alsa_data_free(struct alsa_data *ad)
{
g_free(ad->device);
mixer_free(ad->mixer);
free(ad);
g_free(ad);
}
static void

View File

@@ -131,7 +131,7 @@ audioOutputAo_initDriver(struct audio_output *ao,
static void freeAoData(AoData * ad)
{
ao_free_options(ad->options);
free(ad);
g_free(ad);
}
static void audioOutputAo_finishDriver(void *data)

View File

@@ -92,7 +92,7 @@ mpd_jack_free(struct jack_data *jd)
for (unsigned i = 0; i < G_N_ELEMENTS(jd->output_ports); ++i)
g_free(jd->output_ports[i]);
free(jd);
g_free(jd);
}
static void
@@ -275,7 +275,7 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format)
jd->output_ports[0])) != 0 ) {
g_warning("%s is not a valid Jack Client / Port",
jd->output_ports[0]);
free(port_name);
g_free(port_name);
return -1;
}
sprintf(port_name, "%s:right", name);
@@ -283,10 +283,10 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format)
jd->output_ports[1])) != 0 ) {
g_warning("%s is not a valid Jack Client / Port",
jd->output_ports[1]);
free(port_name);
g_free(port_name);
return -1;
}
free(port_name);
g_free(port_name);
}
return 1;

View File

@@ -124,7 +124,7 @@ static void *mvp_initDriver(G_GNUC_UNUSED struct audio_output *audio_output,
static void mvp_finishDriver(void *data)
{
MvpData *md = data;
free(md);
g_free(md);
}
static int mvp_setPcmParams(MvpData * md, unsigned long rate, int channels,

View File

@@ -292,7 +292,7 @@ static void freeOssData(OssData * od)
mixer_free(od->mixer);
free(od);
g_free(od);
}
#define OSS_STAT_NO_ERROR 0

View File

@@ -90,11 +90,10 @@ osx_initDriver(G_GNUC_UNUSED struct audio_output *audioOutput,
static void freeOsxData(OsxData * od)
{
if (od->buffer)
free(od->buffer);
g_free(od->buffer);
g_mutex_free(od->mutex);
g_cond_free(od->condition);
free(od);
g_free(od);
}
static void osx_finishDriver(void *data)

View File

@@ -81,7 +81,7 @@ static void free_shout_data(struct shout_data *sd)
if (sd->timer)
timer_free(sd->timer);
free(sd);
g_free(sd);
}
#define check_block_param(name) { \