summaryrefslogtreecommitdiffstats
path: root/src/corelib/concurrent/qtconcurrentrunbase.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/concurrent/qtconcurrentrunbase.h')
-rw-r--r--src/corelib/concurrent/qtconcurrentrunbase.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/corelib/concurrent/qtconcurrentrunbase.h b/src/corelib/concurrent/qtconcurrentrunbase.h
index a6bbe3e0c3..888d3952c6 100644
--- a/src/corelib/concurrent/qtconcurrentrunbase.h
+++ b/src/corelib/concurrent/qtconcurrentrunbase.h
@@ -100,7 +100,18 @@ public:
this->reportFinished();
return;
}
- this->runFunctor();
+#ifndef QT_NO_EXCEPTIONS
+ try {
+#endif
+ this->runFunctor();
+#ifndef QT_NO_EXCEPTIONS
+ } catch (QtConcurrent::Exception &e) {
+ QFutureInterface<T>::reportException(e);
+ } catch (...) {
+ QFutureInterface<T>::reportException(QtConcurrent::UnhandledException());
+ }
+#endif
+
this->reportResult(result);
this->reportFinished();
}
@@ -117,7 +128,17 @@ public:
this->reportFinished();
return;
}
- this->runFunctor();
+#ifndef QT_NO_EXCEPTIONS
+ try {
+#endif
+ this->runFunctor();
+#ifndef QT_NO_EXCEPTIONS
+ } catch (QtConcurrent::Exception &e) {
+ QFutureInterface<void>::reportException(e);
+ } catch (...) {
+ QFutureInterface<void>::reportException(QtConcurrent::UnhandledException());
+ }
+#endif
this->reportFinished();
}
};