To: vim_dev@googlegroups.com Subject: Patch 8.2.2113 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2113 Problem: MS-Windows GUI: crash after using ":set guifont=" four times. Solution: Check for NULL pointer. (Ken Takata, closes #7434) Files: src/gui_dwrite.cpp, src/testdir/test_gui.vim *** ../vim-8.2.2112/src/gui_dwrite.cpp 2019-05-05 13:18:45.000000000 +0200 --- src/gui_dwrite.cpp 2020-12-08 21:09:56.080523552 +0100 *************** *** 239,245 **** if (mItems[n].pTextFormat != item.pTextFormat) { SafeRelease(&mItems[n].pTextFormat); ! item.pTextFormat->AddRef(); } mItems[n] = item; slide(n); --- 239,246 ---- if (mItems[n].pTextFormat != item.pTextFormat) { SafeRelease(&mItems[n].pTextFormat); ! if (item.pTextFormat != NULL) ! item.pTextFormat->AddRef(); } mItems[n] = item; slide(n); *** ../vim-8.2.2112/src/testdir/test_gui.vim 2020-09-28 21:41:08.612043808 +0200 --- src/testdir/test_gui.vim 2020-12-08 21:11:41.412059979 +0100 *************** *** 386,391 **** --- 386,398 ---- if has('win32') " Invalid font names are accepted in GTK GUI call assert_fails('set guifont=xa1bc23d7f', 'E596:') + + " doing this four times used to cause a crash + set guifont= + set guifont= + set guifont= + set guifont= + set guifont= endif if has('xfontset') *** ../vim-8.2.2112/src/version.c 2020-12-08 20:39:11.361180690 +0100 --- src/version.c 2020-12-08 21:09:01.056765955 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2113, /**/ -- Kisses may last for as much as, but no more than, five minutes. [real standing law in Iowa, United States of America] /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///