aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMat Berchtold <unknown>2020-02-15 09:02:56 +1100
committerMat Berchtold <unknown>2020-02-15 09:02:56 +1100
commit78c6edfb7534b08a71c3fb9e872d0f3c8a2bc2cc (patch)
tree93940498aff70a4cc3478ec84486f71a96f602e9
parent2761a6e256af7bc378bfab677b0cd8aeafc999b4 (diff)
downloadscintilla-mirror-78c6edfb7534b08a71c3fb9e872d0f3c8a2bc2cc.tar.gz
Bug [#2138]. Potential fix to Direct2D crash when updating driver.
-rw-r--r--doc/ScintillaHistory.html4
-rw-r--r--src/Editor.cxx8
2 files changed, 11 insertions, 1 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 08ddb7571..9a77f6bcf 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -583,6 +583,10 @@
<a href="https://sourceforge.net/p/scintilla/bugs/2152/">Bug #2152</a>.
</li>
<li>
+ Crash fixed with Direct2D on Win32 when updating driver.
+ <a href="https://sourceforge.net/p/scintilla/bugs/2138/">Bug #2138</a>.
+ </li>
+ <li>
For SciTE on Win32, fix crashes when Lua script closes application.
<a href="https://sourceforge.net/p/scintilla/bugs/2155/">Bug #2155</a>.
</li>
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);