diff options
| -rw-r--r-- | win32/ScintillaWin.cxx | 9 | 
1 files changed, 7 insertions, 2 deletions
| diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index a63d803fb..8c08d6ea1 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -2604,7 +2604,7 @@ STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState,  			data.assign(convertedText.c_str(), convertedText.c_str()+convertedText.length()+1);  		} -		if (data.empty()) { +		if (!SUCCEEDED(hr) || data.empty()) {  			//Platform::DebugPrintf("Bad data format: 0x%x\n", hres);  			return hr;  		} @@ -2823,7 +2823,12 @@ sptr_t PASCAL ScintillaWin::CTWndProc(  						drtp.usage = D2D1_RENDER_TARGET_USAGE_NONE;  						drtp.minLevel = D2D1_FEATURE_LEVEL_DEFAULT; -						pD2DFactory->CreateHwndRenderTarget(drtp, dhrtp, &pCTRenderTarget); +						if (!SUCCEEDED(pD2DFactory->CreateHwndRenderTarget(drtp, dhrtp, &pCTRenderTarget))) { +							surfaceWindow->Release(); +							delete surfaceWindow; +							::EndPaint(hWnd, &ps); +							return 0; +						}  						surfaceWindow->Init(pCTRenderTarget, hWnd);  						pCTRenderTarget->BeginDraw();  #endif | 
