summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@idiap.ch>2018-11-17 22:47:54 +0100
committerSamuel Gaist <samuel.gaist@idiap.ch>2018-11-18 10:05:13 +0000
commit144395f0aa8dcebd0c0c9865ac5146be813f3f51 (patch)
tree01d041d2f759a5ae7d7be25b9e7574cc21690512
parent5354677e9253235881e59c838ceaaeed1d18b0f8 (diff)
downloadqtdoc-144395f0aa8dcebd0c0c9865ac5146be813f3f51.tar.gz
Fix the usage of the ret variable in the exception safety code sample
The usage was wrong because of the declaration of the variable in the scope of the try block. Task-number: QTBUG-71587 Change-Id: I52e45c9df6ef41f347c61dd023e126d5ba7715db Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
-rw-r--r--doc/src/howtos/exceptionsafety.qdoc3
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/src/howtos/exceptionsafety.qdoc b/doc/src/howtos/exceptionsafety.qdoc
index 461f275e..8b6a7818 100644
--- a/doc/src/howtos/exceptionsafety.qdoc
+++ b/doc/src/howtos/exceptionsafety.qdoc
@@ -115,8 +115,9 @@
\code
QApplication app(argc, argv);
...
+ int ret;
try {
- int ret = app.exec();
+ ret = app.exec();
} catch (const std::bad_alloc &) {
// clean up here, e.g. save the session
// and close all config files.