diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-09-14 14:07:06 +0100 |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-09-14 14:31:19 +0100 |
commit | c4cab7199590cc6b1901334e8ff604cd876fccee (patch) | |
tree | 9a78be3e822dfa2809f0dab6672f3a88156c6334 /doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp | |
parent | adfa2dde84ff7ed1a8b177c2a7e885e752e9bb0b (diff) | |
download | qt4-tools-c4cab7199590cc6b1901334e8ff604cd876fccee.tar.gz |
Prevent crash when cache is changed on the fly
Calling QNetworkAccessManager::setCache while there were requests
being processed using the existing cache caused crashes due to
deleting the old cache invalidating pointers to the cache data
streams (QTemporaryFile in case of QNetworkDiskCache).
Using pointer to deleted data caused a crash in some cases. It has
undefined behaviour because the memory may have been overwritten or
decommitted.
To fix this, use the deleted signal to notify QNetworkReplyImpl that
the cache has been destroyed. It then clears the pointer to the data
stream and disables caching. This avoids the crash that previously
happened when trying to write to the cache file.
Task-number: QT-5252
Reviewed-by: Peter Hartmann
Diffstat (limited to 'doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp')
0 files changed, 0 insertions, 0 deletions