-
Totally Mad Memory Leak
Anyone seen anything like this before:
Code:
VARIANT myFunc(void);
VARIANT vMyVarOK = myFunc();
_variant_t vMyVarLeaks = myFunc();
I have code where the second assignment leaks memory (you have to cycle it a lot of times, but the leak then beomes significant).
There is no reason I can see why this should be a problem, but its causing a big leak (10+ MB) in my XML writing code...
-
OK, I'm at doofus...
_variant_t constructors do ::VariantCopy's, no wonder it leaked!
It should be done a la:
Code:
_variant_t vMyVarLeaks;
vMyVarLeaks.Attach(myFunc());