diff options
author | Michael Goddard <michael.goddard@nokia.com> | 2009-05-26 00:39:36 (GMT) |
---|---|---|
committer | Michael Goddard <michael.goddard@nokia.com> | 2009-05-26 02:19:25 (GMT) |
commit | 682b854872c26d7408d79131217825fb8ddace6a (patch) | |
tree | 9974a6ed60c37fd233bd675fa9f5e63b9d9c89ba | |
parent | 2248d63c1a32ae84bb6d0bde9021a8074db1b4c9 (diff) | |
download | Qt-682b854872c26d7408d79131217825fb8ddace6a.zip Qt-682b854872c26d7408d79131217825fb8ddace6a.tar.gz Qt-682b854872c26d7408d79131217825fb8ddace6a.tar.bz2 |
BT:Fix access of deleted memory with a static QCursor.
If a QCursor with a predefined shape is declared static, it could be
destroyed after the application dtor has already cleaned up QCursor
memory.
Task-number: 254467
Reviewed-by: Rhys Weatherley
-rw-r--r-- | src/gui/kernel/qcursor.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp index ed7e020..598f4ba 100644 --- a/src/gui/kernel/qcursor.cpp +++ b/src/gui/kernel/qcursor.cpp @@ -375,7 +375,9 @@ void QCursorData::cleanup() return; for (int shape = 0; shape <= Qt::LastCursor; ++shape) { - delete qt_cursorTable[shape]; + // In case someone has a static QCursor defined with this shape + if (!qt_cursorTable[shape]->ref.deref()) + delete qt_cursorTable[shape]; qt_cursorTable[shape] = 0; } QCursorData::initialized = false; |