Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QNetworkInfo: Document threading restriction
Specifically on Windows we use COM, which requires being de-initialized in the same thread as it was initialized. Given that QNetworkInfo is a GLOBAL_STATIC with a qAddPostCondition (iirc APPLICATION_STATIC was not yet implemented at the time) to delete the backend when qApp is destructed, we need to cope with destruction happening on the main thread. If the backend is loaded on a secondary thread, the thread may have shut down, or we may not otherwise be able to rely on emitting Queued emissions to perform the destruction. Conversely we also can't trivially move the construction to the application thread (eg. using BlockingQueued emission during first load) because we may cause a deadlock. This leaves us with just documenting where the first load should happen. Fixes: QTBUG-133644 Pick-to: 6.9 6.8 6.5 Change-Id: I7f52e884151c6c24acc34f1112faabc897d9b0f9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- Loading branch information