diff src/gui_dwrite.cpp @ 23134:26824776adf6 v8.2.2113

patch 8.2.2113: MS-Windows GUI: crash after using ":set guifont=" four times Commit: https://github.com/vim/vim/commit/1b3e0727ce86ca4cfa47f8b5421d82ed47a9bec1 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 8 21:12:40 2020 +0100 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 https://github.com/vim/vim/issues/7434)
author Bram Moolenaar <Bram@vim.org>
date Tue, 08 Dec 2020 21:15:03 +0100
parents 563163ec0244
children a077948be0f4
line wrap: on
line diff
--- a/src/gui_dwrite.cpp
+++ b/src/gui_dwrite.cpp
@@ -239,7 +239,8 @@ public:
 	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);