Don't call CoInitializeEx() from Direct2D code.
This is unnecessary, COM is already initialized on the application startup and Direct2D can't be used before that anyhow. This also fixes lack of matching CoUninitialize() call. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77752 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -232,24 +232,11 @@ BOOL WINAPI wxD2D1InvertMatrix(
|
||||
return wxDirect2D::D2D1InvertMatrix(matrix);
|
||||
}
|
||||
|
||||
static bool gs_isComInitialized = false;
|
||||
|
||||
void wxEnsureCOMLibraryInitialized()
|
||||
{
|
||||
if (!gs_isComInitialized)
|
||||
{
|
||||
CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
||||
gs_isComInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
static IWICImagingFactory* gs_WICImagingFactory = NULL;
|
||||
|
||||
IWICImagingFactory* wxWICImagingFactory()
|
||||
{
|
||||
if (gs_WICImagingFactory == NULL) {
|
||||
wxEnsureCOMLibraryInitialized();
|
||||
|
||||
HRESULT hr = CoCreateInstance(
|
||||
CLSID_WICImagingFactory,
|
||||
NULL,
|
||||
@@ -3474,7 +3461,6 @@ wxGraphicsRenderer* wxGraphicsRenderer::GetDirect2DRenderer()
|
||||
|
||||
wxD2DRenderer::wxD2DRenderer()
|
||||
{
|
||||
wxEnsureCOMLibraryInitialized();
|
||||
|
||||
HRESULT result;
|
||||
result = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &m_direct2dFactory);
|
||||
|
Reference in New Issue
Block a user