[1/2] windowscodecs: Add a test for CreateBitmapFromHICON.

Alexandre Julliard julliard at winehq.org
Fri Jan 11 04:36:39 CST 2013

Dmitry Timoshkov <dmitry at baikal.ru> writes:

> Nikolay Sivov <bunglehead at gmail.com> wrote:
>> >> Who is responsible for freeing icon handle? I guess it should be done
>> >> here cause your implementation doesn't free it either.
>> > You are right, DestroyIcon() is missing at the end of the test. Consider
>> > that as a feature, the tests are not supposed to free all the allocated
>> > resources, it's a waste of time :)
>> >
>> Fixing leaks like that is not optional. One reason to do this is to make 
>> valgrind output clean
>> so it contains only real leaks in code. Another reason is that test 
>> could serve as an example of API
>> usage.
> I'd like to hear Alexandre's opinion on this, but freeing allocated memory
> in tests has never been a requirement, and Wine tests are not supposed to be
> a set of samples to learn windows programming.

In that kind of test it's a good idea to destroy the object right after
it's used, to catch cases where e.g. CreateBitmap would hold a reference
to the icon instead of copying it or things like that.

Alexandre Julliard
julliard at winehq.org

More information about the wine-devel mailing list