Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qcominitializer.cpp
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
6#include <QtCore/private/qfunctions_win_p.h>
7#include <memory>
8
9QT_BEGIN_NAMESPACE
10
11namespace {
12
13// Destroys QComHelper on thread exit, thereby calling CoUninitialize
15
16}
17
18// Initializes COM as a single-threaded apartment on this thread and
19// ensures that CoUninitialize will be called on the same thread when
20// the thread exits. Note that the last call to CoUninitialize on the
21// main thread will always be made during destruction of static
22// variables at process exit.
24 if (!s_comHelperRegistry)
25 s_comHelperRegistry = std::make_unique<QComHelper>();
26}
27
28QT_END_NAMESPACE
thread_local std::unique_ptr< QComHelper > s_comHelperRegistry
void ensureComInitializedOnThisThread()