diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2019-07-24 15:05:23 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2019-07-26 17:59:47 +0200 |
commit | e24a4976bebd7ca90deac2b40c08900625773a99 (patch) | |
tree | 222071dc7fbf1b8b17033109e35b3f8eb08f86ef /src/gui/accessible | |
parent | e6498362fde937259295e9b2ddbe9b59136f47ba (diff) |
QHostInfo: Always post results through the event loop to the receiver
Lookups performed via QHostInfoRunnable must not synchronously call
the user-code's receiver objects, as that would execute user-code in
the wrong thread. Instead, post a metacall event through the event
loop of the receiver object, or the thread that initiated the lookup.
This was done correctly for the trivial cases of empty host name or
cached results, so the code generally existed. By moving it from a
global function into a member function of QHostInfoResult, we can
simply access the required data to construct and post the event.
As we process that posted event, we need to check that the context
object (which is already guarded via QPointer) is still alive, if
we had one in the first place. If we had one, and it's deleted, then
abort.
[ChangeLog][QtNetwork][QHostInfo] Functors used in the lookupHost
overloads are now called correctly in the thread of the context object.
When used without context object, the thread that initiates the lookup
will run the functor, and is required to run an event loop.
Change-Id: I9b38d4f9a23cfc4d9e07bc72de2d2cefe5d0d033
Fixes: QTBUG-76276
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/gui/accessible')
0 files changed, 0 insertions, 0 deletions