acces violation while trying to catch an exception by reference
here is the thing:
i have a constructor that calls a member function, the function throws an exception, i catch the exception in the constructor, free all dynamic allocated variables and then rethrow the exception.
when i try to rethrow it i get the following message:
Unhandled exception at 0x10210e32 (msvcr80d.dll) in Test.exe: 0xC0000005: Access violation reading location 0xcdcdcdc8.
and I'm stuck in dbgheap.c at line 1595
any ideeas are welcomed :) , thx
Re: acces violation while trying to catch an exception by reference
Please post the code for the function that is causing the problem (i.e. the place where you re-throw at the very least). It sounds like you have deleted an object the reference is either directly or indirectly pointing to.
Re: acces violation while trying to catch an exception by reference
Quote:
Originally Posted by kux
here is the thing:
i have a constructor that calls a member function, the function throws an exception, i catch the exception in the constructor, free all dynamic allocated variables and then rethrow the exception.
when i try to rethrow it i get the following message:
Unhandled exception at 0x10210e32 (msvcr80d.dll) in Test.exe: 0xC0000005: Access violation reading location 0xcdcdcdc8.
and I'm stuck in dbgheap.c at line 1595
any ideeas are welcomed :) , thx
0xcdcdcdc8 <<--- im most cases this is an uninitialized variable memory pattern!
Re: acces violation while trying to catch an exception by reference
it's ok, i found the problem.
had nothing to do with memory allocs, i forgot to include a header required for the exception i was throwing. the wierd thing is that i had no compile error, just this strange runtime error
thx for the help