diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-10-01 20:19:10 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-10-01 21:42:00 -0300 |
commit | 45525853d3521e73512f68bb390aae0e385ef66c (patch) | |
tree | 1633766a082252e2b1074968377d1fd98481e496 /src/nvim/os/wstream_defs.h | |
parent | ba1026c2c7a39b92e5c50bee653cb7bca3d1f759 (diff) | |
download | rneovim-45525853d3521e73512f68bb390aae0e385ef66c.tar.gz rneovim-45525853d3521e73512f68bb390aae0e385ef66c.tar.bz2 rneovim-45525853d3521e73512f68bb390aae0e385ef66c.zip |
wstream/shell: Fix memory errors caused by os_system
The os_system function uses a write callback to close the input stream when the
write completes, but this causes a memory error because the callback is invoked
right before the stream is freed by the caller.
This fixes the problem by removing the callback set by os_system. Instead, it
calls job_close_in immediately after writing(the stream will only close after
the write completes). The 'pending' parameter was also removed from the
'write_cb' as it should be hidden by the wstream module.
While the `wstream_set_write_cb` and `job_write_cb` are no longer used, they
will remain in the codebase for future use.
Diffstat (limited to 'src/nvim/os/wstream_defs.h')
-rw-r--r-- | src/nvim/os/wstream_defs.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/nvim/os/wstream_defs.h b/src/nvim/os/wstream_defs.h index e42481f283..cfa0bf0b60 100644 --- a/src/nvim/os/wstream_defs.h +++ b/src/nvim/os/wstream_defs.h @@ -10,11 +10,9 @@ typedef void (*wbuffer_data_finalizer)(void *data); /// /// @param wstream The `WStream` instance /// @param data User-defined data -/// @param pending The number of write requests that are still pending /// @param status 0 on success, anything else indicates failure typedef void (*wstream_cb)(WStream *wstream, void *data, - size_t pending, int status); #endif // NVIM_OS_WSTREAM_DEFS_H |