[PATCH] ddraw: Avoid break in __TRY blocks.

Alex Henrie alexhenrie24 at gmail.com
Tue Feb 14 16:29:01 CST 2017


2017-02-14 15:15 GMT-07:00 Stefan Dösinger <stefandoesinger at gmx.at>:
>
>> Am 14.02.2017 um 22:01 schrieb Sebastian Lackner <sebastian at fds-team.de>:
>>
>> While you are just at it, please note that this code also contains a leak
>> when the exception is triggered. Actually, it would probably be easier to
>> test if the pointer is writeable in advance, and exit early without creating
>> the surface at all.
> I wouldn’t be the least bit surprised if Windows leaked in this situation as well. But I guess for the test it is relevant for Valgrind runs.
>
> A pre-emptive
>
> __TRY
> {
>     *surface = NULL;
> }
> __EXCEPT_PAGE_FAULT
> {
>     return E_INVALIDARG;
> }
>
> before doing any work would be nicer, if it doesn’t have any unexpected side effects (e.g. Windows might keep *surface alone in some error conditions, which wouldn’t surprise me either).
>
> Alex, can you look into fixing the leak?

Yes, I'll look into it. Sorry for not noticing the leak before.

-Alex



More information about the wine-devel mailing list