4 ms·
> You can't have a single cleanup (because subsequent calls use memory/handles from prior Why not? You just initialize them all to NULL (or INVALID_HANDLE_VALU
by int_19h 10y ago
> You can't have a single cleanup (because subsequent calls use memory/handles from prior
Why not? You just initialize them all to NULL (or INVALID_HANDLE_VALUE etc, as appropriate). And then in your cleanup block, you check whether each was initialized, and clean it up. So long as you consistently do this in reverse order of their initialization, it works.