summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Fernengel <harald@trolltech.com>2009-06-16 16:47:01 (GMT)
committerHarald Fernengel <harald@trolltech.com>2009-06-16 16:47:01 (GMT)
commit508f8680052bb8dd9ead1de7923481b31fef3f93 (patch)
tree341cb5c7ac5a861fb03ffc22bf286ba9cec70103 /src
parent0736c37064a4e22c81f2190d8e2375c78b238944 (diff)
downloadQt-508f8680052bb8dd9ead1de7923481b31fef3f93.zip
Qt-508f8680052bb8dd9ead1de7923481b31fef3f93.tar.gz
Qt-508f8680052bb8dd9ead1de7923481b31fef3f93.tar.bz2
Fix crash in case of out of memory
RevBy: Robert Griebl
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qlayout.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/kernel/qlayout.cpp b/src/gui/kernel/qlayout.cpp
index 4463aab..d8d8234 100644
--- a/src/gui/kernel/qlayout.cpp
+++ b/src/gui/kernel/qlayout.cpp
@@ -145,7 +145,12 @@ QLayout::QLayout(QLayoutPrivate &dd, QLayout *lay, QWidget *w)
} else {
d->topLevel = true;
w->d_func()->layout = this;
- invalidate();
+ QT_TRY {
+ invalidate();
+ } QT_CATCH(...) {
+ w->d_func()->layout = 0;
+ QT_RETHROW;
+ }
}
}
}
@@ -230,7 +235,12 @@ QLayout::QLayout(QWidget *parent, int margin, int spacing, const char *name)
} else {
d->topLevel = true;
parent->d_func()->layout = this;
- invalidate();
+ QT_TRY {
+ invalidate();
+ } QT_CATCH(...) {
+ parent->d_func()->layout = 0;
+ QT_RETHROW;
+ }
}
}
}