mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 14:56:08 +00:00
wstream: allow empty release wbuffer cb
Sometimes a wbuffer is not supposed to be free()'d (such as when it comes from a constant (possibly static) string, for example.
This commit is contained in:

committed by
Thiago de Arruda

parent
06cc046e30
commit
891b4b9d2b
@@ -204,7 +204,10 @@ static void write_cb(uv_write_t *req, int status)
|
||||
static void release_wbuffer(WBuffer *buffer)
|
||||
{
|
||||
if (!--buffer->refcount) {
|
||||
if (buffer->cb) {
|
||||
buffer->cb(buffer->data);
|
||||
}
|
||||
|
||||
free(buffer);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user