Christ van Willegen wrote:
> On Sun, Feb 28, 2016 at 3:49 PM, Bram Moolenaar <[email protected]> wrote:
> >
> > Patch 7.4.1447
> > Problem: Memory leak when using ch_read(). (Dominique Pelle)
> > No log message when stopping a job and a few other situations.
> > Too many "Nothing to read" messages. Channels are not freed.
> > Solution: Free the listtv. Add more log messages. Remove "Nothing to
> > read"
> > message. Remove the channel from the job when its refcount
> > becomes zero.
> > Files: src/eval.c, src/channel.c
> >
> >
> > *** ../vim-7.4.1446/src/eval.c 2016-02-27 21:27:16.550519087 +0100
> > --- src/eval.c 2016-02-28 15:28:31.019487430 +0100
> > ***************
> > *** 7796,7802 ****
> > --- 7797,7813 ----
> > * "stoponexit" flag or an exit callback. */
> > if (job->jv_status != JOB_STARTED
> > || (job->jv_stoponexit == NULL && job->jv_exit_cb == NULL))
> > + {
> > job_free(job);
> > + }
>
> Any particular reason these {} were added? It seems contrary to the
> usual coding style...
There are also {} for the following "else" block. Usually the {} are
either used for both the "if" and "else" block or neither. In this case
it's also because the condition is split over two lines, which makes the
statement a bit harder to spot.
Plug: With my Zimbu language design I took away this discussion by Never
using the { and always using the }:
IF cond
if-block
ELSE
else-block
}
I'm sure most people find this unusual at first. Once you get used to
it, it works very well. You can see } as an END, but it's less wordy.
--
The most powerful force in the universe is gossip.
/// Bram Moolenaar -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.