Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
23133:6d5bc7eb0e86 | 23134:26824776adf6 |
---|---|
237 if (n < 0) | 237 if (n < 0) |
238 n = mSize - 1; | 238 n = mSize - 1; |
239 if (mItems[n].pTextFormat != item.pTextFormat) | 239 if (mItems[n].pTextFormat != item.pTextFormat) |
240 { | 240 { |
241 SafeRelease(&mItems[n].pTextFormat); | 241 SafeRelease(&mItems[n].pTextFormat); |
242 item.pTextFormat->AddRef(); | 242 if (item.pTextFormat != NULL) |
243 item.pTextFormat->AddRef(); | |
243 } | 244 } |
244 mItems[n] = item; | 245 mItems[n] = item; |
245 slide(n); | 246 slide(n); |
246 } | 247 } |
247 | 248 |