[Spice-devel] [PATCH spice-server 14/15] jpeg encoder: Remove unused jpeg_encoder_destroy

Pavel Grunt pgrunt at redhat.com
Thu Nov 19 23:07:27 PST 2015


Hi Jonathon,

On Thu, 2015-11-19 at 14:32 -0600, Jonathon Jongsma wrote:
> Are you sure we're not just leaking the encoder right now? Perhaps we should
> be
> calling this function somewhere. Same for lz4_encoder_destroy().
> 
I know that it is unused. As I said in the cover letter, it is strange that
_destroy() is not called, I'm looking into it now.

Pavel

> 
> 
> On Thu, 2015-11-19 at 20:45 +0100, Pavel Grunt wrote:
> > It was introduced in 263646a1f7e705766f7d46017679812d4b1406b8
> > but never used.
> > 
> > Signed-off-by: Pavel Grunt <pgrunt at redhat.com>
> > ---
> >  server/jpeg_encoder.c | 6 ------
> >  server/jpeg_encoder.h | 1 -
> >  2 files changed, 7 deletions(-)
> > 
> > diff --git a/server/jpeg_encoder.c b/server/jpeg_encoder.c
> > index 0296e9b..0e72621 100644
> > --- a/server/jpeg_encoder.c
> > +++ b/server/jpeg_encoder.c
> > @@ -98,12 +98,6 @@ JpegEncoderContext*
> > jpeg_encoder_create(JpegEncoderUsrContext *usr)
> >      return (JpegEncoderContext*)enc;
> >  }
> >  
> > -void jpeg_encoder_destroy(JpegEncoderContext* encoder)
> > -{
> > -    jpeg_destroy_compress(&((JpegEncoder*)encoder)->cinfo);
> > -    free(encoder);
> > -}
> > -
> >  static void convert_RGB16_to_RGB24(void *line, int width, uint8_t
> > **out_line)
> >  {
> >      uint16_t *src_line = line;
> > diff --git a/server/jpeg_encoder.h b/server/jpeg_encoder.h
> > index 690a029..5c94b93 100644
> > --- a/server/jpeg_encoder.h
> > +++ b/server/jpeg_encoder.h
> > @@ -51,7 +51,6 @@ struct JpegEncoderUsrContext {
> >  };
> >  
> >  JpegEncoderContext* jpeg_encoder_create(JpegEncoderUsrContext *usr);
> > -void jpeg_encoder_destroy(JpegEncoderContext *encoder);
> >  
> >  /* returns the total size of the encoded data. Images must be supplied from
> > the
> >     top line to the bottom */


More information about the Spice-devel mailing list