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
4
#
include
"qcominitializer_p.h"
5
6
#
include
<
QtCore
/
private
/
qfunctions_win_p
.
h
>
7
#
include
<
memory
>
8
9
QT_BEGIN_NAMESPACE
10
11
namespace
{
12
13
// Destroys QComHelper on thread exit, thereby calling CoUninitialize
14
thread_local
std
::
unique_ptr
<
QComHelper
>
s_comHelperRegistry
;
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.
23
void
ensureComInitializedOnThisThread
() {
24
if
(!s_comHelperRegistry)
25
s_comHelperRegistry = std::make_unique<QComHelper>();
26
}
27
28
QT_END_NAMESPACE
QT_BEGIN_NAMESPACE::s_comHelperRegistry
thread_local std::unique_ptr< QComHelper > s_comHelperRegistry
Definition
qcominitializer.cpp:14
ensureComInitializedOnThisThread
void ensureComInitializedOnThisThread()
Definition
qcominitializer.cpp:23
qtmultimedia
src
multimedia
windows
qcominitializer.cpp
Generated on Thu Nov 14 2024 00:50:39 for Qt by
1.12.0