|
-
January 23rd, 2008, 07:12 AM
#1
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
-
January 23rd, 2008, 07:49 AM
#2
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.
-
January 24th, 2008, 03:32 AM
#3
Re: acces violation while trying to catch an exception by reference
 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!
-
January 24th, 2008, 09:32 AM
#4
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|