diff options
author | Samuel Gaist <samuel.gaist@idiap.ch> | 2018-11-17 22:47:54 +0100 |
---|---|---|
committer | Samuel Gaist <samuel.gaist@idiap.ch> | 2018-11-18 10:05:13 +0000 |
commit | 144395f0aa8dcebd0c0c9865ac5146be813f3f51 (patch) | |
tree | 01d041d2f759a5ae7d7be25b9e7574cc21690512 | |
parent | 5354677e9253235881e59c838ceaaeed1d18b0f8 (diff) | |
download | qtdoc-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.qdoc | 3 |
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. |