refactor: introduce XFREE_CLEAR()

Unfortunately we cannot indiscriminately replace xfree() with
XFREE_CLEAR(), because comparing pointers after freeing them is a common
pattern. Example in `tv_list_remove_items()`:

    xfree(li);
    if (li == item2) {
      break;
    }

Instead we can do it selectively/explicitly.

ref #1375
This commit is contained in:
Justin M. Keyes
2019-05-22 00:10:35 +02:00
parent 4769deb36a
commit a9d7ec4587
8 changed files with 33 additions and 20 deletions

View File

@@ -148,10 +148,10 @@ describe('autocmd', function()
funcs.execute('autocmd Tabnew'))
end)
it('window works', function()
-- Nvim uses a special window to execute certain actions for an invisible buffer,
-- internally called autcmd_win and mentioned in the docs at :help E813
-- Do some safety checks for redrawing and api accesses to this window.
it('internal `aucmd_win` window', function()
-- Nvim uses a special internal window `aucmd_win` to execute certain
-- actions for an invisible buffer (:help E813).
-- Check redrawing and API accesses to this window.
local screen = Screen.new(50, 10)
screen:attach()