From 78c6edfb7534b08a71c3fb9e872d0f3c8a2bc2cc Mon Sep 17 00:00:00 2001 From: Mat Berchtold Date: Sat, 15 Feb 2020 09:02:56 +1100 Subject: Bug [#2138]. Potential fix to Direct2D crash when updating driver. --- src/Editor.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Editor.cxx') diff --git a/src/Editor.cxx b/src/Editor.cxx index 016ef3383..9c4ad2d4f 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1752,7 +1752,13 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { } RefreshPixMaps(surfaceWindow); // In case pixmaps invalidated by scrollbar change } - PLATFORM_ASSERT(marginView.pixmapSelPattern->Initialised()); + + if (!marginView.pixmapSelPattern->Initialised()) { + // When Direct2D is used, pixmap creation may fail with D2DERR_RECREATE_TARGET so + // abandon this paint to avoid further failures. + // Main drawing surface and pixmaps should be recreated by next paint. + return; + } if (!view.bufferedDraw) surfaceWindow->SetClip(rcArea); -- cgit v1.2.3