Commit a2bcf6e5 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[2202] Comment catching of exceptions

parent 408728e4
...@@ -144,7 +144,10 @@ Thread::wait() { ...@@ -144,7 +144,10 @@ Thread::wait() {
// Was there an exception in the thread? // Was there an exception in the thread?
scoped_ptr<UncaughtException> ex; scoped_ptr<UncaughtException> ex;
try { // Something in here could in theory throw. // Something here could in theory throw. But we already terminated the thread, so
// we need to make sure we are in consistent state even in such situation (like
// releasing the mutex and impl_).
try {
if (impl_->exception_) { if (impl_->exception_) {
ex.reset(new UncaughtException(__FILE__, __LINE__, ex.reset(new UncaughtException(__FILE__, __LINE__,
impl_->exception_text_.c_str())); impl_->exception_text_.c_str()));
...@@ -152,6 +155,8 @@ Thread::wait() { ...@@ -152,6 +155,8 @@ Thread::wait() {
} catch (...) { } catch (...) {
Impl::done(impl_); Impl::done(impl_);
impl_ = NULL; impl_ = NULL;
// We have eaten the UncaughtException by now, but there's another
// exception instead, so we have at least something.
throw; throw;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment