diff --git a/src/msw/graphicsd2d.cpp b/src/msw/graphicsd2d.cpp index 13534bc9a5..ce55f1158c 100644 --- a/src/msw/graphicsd2d.cpp +++ b/src/msw/graphicsd2d.cpp @@ -2078,6 +2078,7 @@ wxD2DFontData::wxD2DFontData(wxGraphicsRenderer* renderer, ID2D1Factory* d2dFact wxCOMPtr gdiInterop; hr = wxDWriteFactory()->GetGdiInterop(&gdiInterop); + wxCHECK_HRESULT_RET(hr); LOGFONTW logfont; GetObjectW(font.GetHFONT(), sizeof(logfont), &logfont); @@ -2092,6 +2093,7 @@ wxD2DFontData::wxD2DFontData(wxGraphicsRenderer* renderer, ID2D1Factory* d2dFact } hr = gdiInterop->CreateFontFromLOGFONT(&logfont, &m_font); + wxCHECK_HRESULT_RET(hr); wxCOMPtr fontFamily; m_font->GetFontFamily(&fontFamily); @@ -2119,6 +2121,8 @@ wxD2DFontData::wxD2DFontData(wxGraphicsRenderer* renderer, ID2D1Factory* d2dFact &m_textFormat); delete[] name; + + wxCHECK_HRESULT_RET(hr); } wxCOMPtr wxD2DFontData::CreateTextLayout(const wxString& text) const @@ -2137,6 +2141,7 @@ wxCOMPtr wxD2DFontData::CreateTextLayout(const wxString& text MAX_WIDTH, MAX_HEIGHT, &textLayout); + wxCHECK2_HRESULT_RET(hr, wxCOMPtr(NULL)); DWRITE_TEXT_RANGE textRange = { 0, (UINT32) text.length() };