windowscodecs: Create a IWICMetadataReader when loading a TIFF frame.

Dmitry Timoshkov dmitry at
Mon Jun 18 09:51:13 CDT 2012

Dmitry Timoshkov <dmitry at> wrote:

> > Also, I just noticed that you're calling create_metadata_reader
> > unconditionally from QueryInterface, and not checking in the process
> > whether the reader has already been created. That will leak if QI is
> > called multiple times.
> > 
> > I'm not sure doing real work inside QueryInterface is a good idea.
> > It's pretty surprising.
> > 
> > I think it would make more sense to do this when a method on
> > IWICMetadataBlockReader is first called, or in Initialize if
> > WICDecodeMetadataCacheOnLoad is specified (though doing it in
> > Initialize would require creating the frame objects then as well, and
> > probably combining their refcounts with the parent).
> MSDN suggests different ways of creating a metadata reader:
> 1. when creating a IWICBitmapFrameDecode
> 2. when creating a block reader
> 3. inside of GetReaderByIndex
> It's all up to an implementor. I decided to that at #1. Each instance
> of IWICBitmapFrameDecode has its own metadata reader, I don't see how
> it could be created twice or leaked.

I take that back, thanks for the comments!


More information about the wine-devel mailing list