[Spice-commits] 2 commits - src/channel-display.c src/channel-display-gst.c src/channel-display-mjpeg.c src/decode-glz.c src/decode-jpeg.c src/decode-zlib.c src/spice-session.c src/spice-uri.c tools/spicy.c
Marc-André Lureau
elmarco at kemper.freedesktop.org
Thu Aug 10 13:32:37 UTC 2017
src/channel-display-gst.c | 8 ++++----
src/channel-display-mjpeg.c | 6 +++---
src/channel-display.c | 4 ++--
src/decode-glz.c | 10 +++++-----
src/decode-jpeg.c | 2 +-
src/decode-zlib.c | 4 ++--
src/spice-session.c | 2 +-
src/spice-uri.c | 2 +-
tools/spicy.c | 2 +-
9 files changed, 20 insertions(+), 20 deletions(-)
New commits:
commit 01d5942e326ffa371637c017446ae77db11f35b3
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date: Thu Aug 10 11:30:41 2017 +0200
Prefer g_new() over spice_new()
spice_new() should probably be replaced by g_new() in all spice code
that depend on glib.
Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
Acked-by: Victor Toso <victortoso at redhat.com>
diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
index d7f47d1..f978602 100644
--- a/src/channel-display-gst.c
+++ b/src/channel-display-gst.c
@@ -82,7 +82,7 @@ typedef struct SpiceGstFrame {
static SpiceGstFrame *create_gst_frame(GstBuffer *buffer, SpiceFrame *frame)
{
- SpiceGstFrame *gstframe = spice_new(SpiceGstFrame, 1);
+ SpiceGstFrame *gstframe = g_new(SpiceGstFrame, 1);
gstframe->timestamp = GST_BUFFER_PTS(buffer);
gstframe->frame = frame;
gstframe->sample = NULL;
@@ -95,7 +95,7 @@ static void free_gst_frame(SpiceGstFrame *gstframe)
if (gstframe->sample) {
gst_sample_unref(gstframe->sample);
}
- free(gstframe);
+ g_free(gstframe);
}
@@ -474,7 +474,7 @@ static void spice_gst_decoder_destroy(VideoDecoder *video_decoder)
}
g_queue_free(decoder->display_queue);
- free(decoder);
+ g_free(decoder);
/* Don't call gst_deinit() as other parts of the client
* may still be using GStreamer.
@@ -595,7 +595,7 @@ VideoDecoder* create_gstreamer_decoder(int codec_type, display_stream *stream)
g_return_val_if_fail(VALID_VIDEO_CODEC_TYPE(codec_type), NULL);
if (gstvideo_init()) {
- decoder = spice_new0(SpiceGstDecoder, 1);
+ decoder = g_new0(SpiceGstDecoder, 1);
decoder->base.destroy = spice_gst_decoder_destroy;
decoder->base.reschedule = spice_gst_decoder_reschedule;
decoder->base.queue_frame = spice_gst_decoder_queue_frame;
diff --git a/src/channel-display-mjpeg.c b/src/channel-display-mjpeg.c
index 563dc1b..f0d55f6 100644
--- a/src/channel-display-mjpeg.c
+++ b/src/channel-display-mjpeg.c
@@ -294,7 +294,7 @@ static void mjpeg_decoder_destroy(VideoDecoder* video_decoder)
g_queue_free(decoder->msgq);
jpeg_destroy_decompress(&decoder->mjpeg_cinfo);
g_free(decoder->out_frame);
- free(decoder);
+ g_free(decoder);
}
G_GNUC_INTERNAL
@@ -302,7 +302,7 @@ VideoDecoder* create_mjpeg_decoder(int codec_type, display_stream *stream)
{
g_return_val_if_fail(codec_type == SPICE_VIDEO_CODEC_TYPE_MJPEG, NULL);
- MJpegDecoder *decoder = spice_new0(MJpegDecoder, 1);
+ MJpegDecoder *decoder = g_new0(MJpegDecoder, 1);
decoder->base.destroy = mjpeg_decoder_destroy;
decoder->base.reschedule = mjpeg_decoder_reschedule;
@@ -322,7 +322,7 @@ VideoDecoder* create_mjpeg_decoder(int codec_type, display_stream *stream)
decoder->mjpeg_src.term_source = mjpeg_src_term;
decoder->mjpeg_cinfo.src = &decoder->mjpeg_src;
- /* All the other fields are initialized to zero by spice_new0(). */
+ /* All the other fields are initialized to zero by g_new0(). */
return (VideoDecoder*)decoder;
}
diff --git a/src/channel-display.c b/src/channel-display.c
index 45742a6..4c570ea 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -1511,14 +1511,14 @@ static void display_handle_stream_data(SpiceChannel *channel, SpiceMsgIn *in)
* decoding and best decide if/when to drop them when they are late,
* taking into account the impact on later frames.
*/
- frame = spice_new(SpiceFrame, 1);
+ frame = g_new(SpiceFrame, 1);
frame->mm_time = op->multi_media_time;
frame->dest = *stream_get_dest(st, in);
frame->size = spice_msg_in_frame_data(in, &frame->data);
frame->data_opaque = in;
frame->ref_data = (void*)spice_msg_in_ref;
frame->unref_data = (void*)spice_msg_in_unref;
- frame->free = (void*)free;
+ frame->free = (void*)g_free;
if (!st->video_decoder->queue_frame(st->video_decoder, frame, latency)) {
destroy_stream(channel, op->id);
report_invalid_stream(channel, op->id);
commit fdba1a9bc5ebde9f5d4652047596056bcd127d37
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date: Thu Aug 10 12:04:06 2017 +0200
Use g_free() appropriately
g_free() should be used in pair with g_malloc/new().
There is only free() calls remaining for usbredir rules now.
Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
Acked-by: Victor Toso <victortoso at redhat.com>
diff --git a/src/decode-glz.c b/src/decode-glz.c
index 2776539..9091ea9 100644
--- a/src/decode-glz.c
+++ b/src/decode-glz.c
@@ -71,7 +71,7 @@ static void glz_image_destroy(struct glz_image *img)
return;
pixman_image_unref(img->surface);
- free(img);
+ g_free(img);
}
/* ------------------------------------------------------------------ */
@@ -108,7 +108,7 @@ static void glz_decoder_window_resize(SpiceGlzDecoderWindow *w)
new_slot = w->images[i]->hdr.id % (w->nimages * 2);
new_images[new_slot] = w->images[i];
}
- free(w->images);
+ g_free(w->images);
w->images = new_images;
w->nimages *= 2;
}
@@ -435,8 +435,8 @@ void glz_decoder_window_destroy(SpiceGlzDecoderWindow *w)
return;
glz_decoder_window_clear(w);
- free(w->images);
- free(w);
+ g_free(w->images);
+ g_free(w);
}
SpiceGlzDecoder *glz_decoder_new(SpiceGlzDecoderWindow *w)
@@ -449,5 +449,5 @@ SpiceGlzDecoder *glz_decoder_new(SpiceGlzDecoderWindow *w)
void glz_decoder_destroy(SpiceGlzDecoder *d)
{
- free(d);
+ g_free(d);
}
diff --git a/src/decode-jpeg.c b/src/decode-jpeg.c
index 697d0de..6335153 100644
--- a/src/decode-jpeg.c
+++ b/src/decode-jpeg.c
@@ -187,5 +187,5 @@ void jpeg_decoder_destroy(SpiceJpegDecoder *decoder)
GlibJpegDecoder *d = SPICE_CONTAINEROF(decoder, GlibJpegDecoder, base);
jpeg_destroy_decompress(&d->_cinfo);
- free(d);
+ g_free(d);
}
diff --git a/src/decode-zlib.c b/src/decode-zlib.c
index a5325c0..80f384a 100644
--- a/src/decode-zlib.c
+++ b/src/decode-zlib.c
@@ -76,7 +76,7 @@ SpiceZlibDecoder *zlib_decoder_new(void)
return &d->base;
fail:
- free(d);
+ g_free(d);
return NULL;
}
@@ -85,5 +85,5 @@ void zlib_decoder_destroy(SpiceZlibDecoder *decoder)
GlibZlibDecoder *d = SPICE_CONTAINEROF(decoder, GlibZlibDecoder, base);
inflateEnd(&d->_z_strm);
- free(d);
+ g_free(d);
}
diff --git a/src/spice-session.c b/src/spice-session.c
index d236808..2aabf58 100644
--- a/src/spice-session.c
+++ b/src/spice-session.c
@@ -2276,7 +2276,7 @@ static void spice_session_channel_destroy(SpiceSession *session, SpiceChannel *c
}
ring_remove(&item->link);
- free(item);
+ g_free(item);
g_signal_emit(session, signals[SPICE_SESSION_CHANNEL_DESTROY], 0, channel);
diff --git a/src/spice-uri.c b/src/spice-uri.c
index 0376cd8..ae1347b 100644
--- a/src/spice-uri.c
+++ b/src/spice-uri.c
@@ -211,7 +211,7 @@ gboolean spice_uri_parse(SpiceURI *self, const gchar *_uri, GError **error)
success = TRUE;
end:
- free(uri_scheme);
+ g_free(uri_scheme);
g_free(dup);
g_strfreev(uriv);
return success;
diff --git a/tools/spicy.c b/tools/spicy.c
index 40cd6b3..a09f8cd 100644
--- a/tools/spicy.c
+++ b/tools/spicy.c
@@ -1880,7 +1880,7 @@ static void connection_destroy(spice_connection *conn)
{
g_object_unref(conn->session);
g_hash_table_unref(conn->transfers);
- free(conn);
+ g_free(conn);
connections--;
SPICE_DEBUG("%s (%d)", __FUNCTION__, connections);
More information about the Spice-commits
mailing list