
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 0.57 KB | hits: 12 | expires: Never
Why aren't my destructors called when throwing from a win32 timer callback?
class CFoo
{
public:
~CFoo() {printf(__FUNCTION__ "n");}
};
std::vector< CFoo > GetFooVect()
{
std::vector< CFoo > rValue;
rValue.push_back(CFoo());
rValue.push_back(CFoo());
rValue.push_back(CFoo());
return rValue;
}
VOID CALLBACK Timer(HWND hwnd,
UINT uMsg,
UINT_PTR idEvent,
DWORD dwTime)
{
// My destructors aren't called?
std::vector< CFoo> fooVect = GetFooVect();
// I'm destroyed
CFoo aFoo;
throw FooExcept();
printf("Also Heren");
}