patch 8.2.2113: MS-Windows GUI: crash after using ":set guifont=" four times
Problem: MS-Windows GUI: crash after using ":set guifont=" four times.
Solution: Check for NULL pointer. (Ken Takata, closes #7434)
diff --git a/src/gui_dwrite.cpp b/src/gui_dwrite.cpp
index 8767dc1..83acdab 100644
--- a/src/gui_dwrite.cpp
+++ b/src/gui_dwrite.cpp
@@ -239,7 +239,8 @@
if (mItems[n].pTextFormat != item.pTextFormat)
{
SafeRelease(&mItems[n].pTextFormat);
- item.pTextFormat->AddRef();
+ if (item.pTextFormat != NULL)
+ item.pTextFormat->AddRef();
}
mItems[n] = item;
slide(n);