On Friday, February 03, 2012 2:43:57 PM Dmitry Timoshkov wrote: > Aric Stewart <[email protected]> wrote: > > - REGFILTER2 *prf2; > > + static REGFILTER2 *prf2; > > What's the point of this change?
It returns a pointer to the pointer, so the variable needs to remain valid after the function exits. The code doesn't really feel safe, though. At the very least, I think the pointer should perhaps be made part of the implementation object, but even that feels kinda ugly. What happens if it's called multiple times? REGFILTER **r1, **r2; obj->ParseFilterData(data1, cb1, &r1); obj->ParseFilterData(data2, cb2, &r2); ok(r1 == r2, "Oops\n"); CoTaskMemFree(*r1); /* *r2 is freed now, too */ Doesn't really seem right to me.
