aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/libsupc++/eh_globals.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/libsupc++/eh_globals.cc')
-rw-r--r--libstdc++-v3/libsupc++/eh_globals.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/libstdc++-v3/libsupc++/eh_globals.cc b/libstdc++-v3/libsupc++/eh_globals.cc
index b63fc1e8985..0f0dee58d45 100644
--- a/libstdc++-v3/libsupc++/eh_globals.cc
+++ b/libstdc++-v3/libsupc++/eh_globals.cc
@@ -48,7 +48,17 @@ static void
get_globals_dtor (void *ptr)
{
if (ptr)
- std::free (ptr);
+ {
+ __cxa_exception *exn, *next;
+ exn = ((__cxa_eh_globals *) ptr)->caughtExceptions;
+ while (exn)
+ {
+ next = exn->nextException;
+ _Unwind_DeleteException (&exn->unwindHeader);
+ exn = next;
+ }
+ std::free (ptr);
+ }
}
static void