-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am 2014-03-14 16:27, schrieb Henri Verbeet:
On 14 March 2014 14:50, Stefan Dösinger stefan@codeweavers.com wrote:
- if ((old = wined3d_private_store_get_private_data(store, guid)) && old->size == data_size)
- {
IUnknown *release = NULL;
if (old->flags & WINED3DSPD_IUNKNOWN)
release = old->content.object;
memcpy(old->content.data, ptr, data_size);
old->flags = flags;
if (flags & WINED3DSPD_IUNKNOWN)
IUnknown_AddRef(old->content.object);
if (release)
IUnknown_Release(release);
return WINED3D_OK;
- }
What is the motivation for this? It certainly doesn't make the code
any prettier.
Avoid re-allocating the same sized object needlessly. But I don't feel
strongly about it.
I'll send a separate patch that fixes the release before addref
problem without retaining the allocated memory. Pick whichever you like.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -
http://www.enigmail.net/
iQIcBAEBAgAGBQJTIyb4AAoJEN0/YqbEcdMw4A4QAJHCponfvsfW50Hq+Oumolxo
yP9nEnNz41PsMrWIKPN10McjJDlN002G7wy9B1WQu52zbNHAnt8eIetRb96S+b6i
WP5dRF7dx1LWSbK0x/qek7vZAqWapLtvxhxRxNxM/k6jTetWfpI2WC+tmzXS49Z1
ZlgsvI2zx6rzfGpfMbvXIhBfUtm4aPb+OIJ3zaytctZPBcSa9V+xUo43faLRKljz
zEV4C1Vn/Jqx6PMjx6zQ968/sUQq0P5D5fUq/UBStUEPyRhscneKpmaQSmeKO0tG
Y9FlwXdnd1Gv7jZqT8Ixx/QAb4voql1hUqh9ZVxx/DoqwJzCbDXNprzIQG0+hlFq
mAFBOUVhuqH2bokiFkbOh66h4TEBScQcfEraPdbA48FumQ06o0cl6HTRXN+O76jg
SI02NVjol603BFzjfobE3RULi0ar+HVholu9fz3z8MzRvXLnWXXh2W9HH1mDgJ3u
/PSBduOjal+lJWn7ZYo/ZlLMWKWLDIYgRzhB6fpqUAQg3kGtuh9N14WgQWEwOhaK
NPO5u1CL2z/LN6qdjyYWhEJiRCh1XV4l8d8Waq4KOPnySnGQiPFMQUTGwUEix3SU
fCZYCSDgVAL9y9m35A/JyFaCA2Vn+z6SUcO0g1UKtVKroD7JRb1ayqN6WVX2nEkH
8oWDPyCqOY0fIaUrKh6l
=fdE1
-----END PGP SIGNATURE-----