Hi,

2017/7/27 Thu 21:54:23 UTC+9 Ken Takata wrote:
> Hi,
> 
> I found memory leakage in term_and_job_init() on Win32.
> I also added a workaround when AssignProcessToJobObject() failed.  This the 
> same
> as mch_job_start() in os_win32.c and would be useful on Windows 7 or earlier.
> Please check the attached patch.

And here is another patch written by mattn, which fixes refcount problem.
Jobs were freed unexpectedly by GC.
Please apply this after my previous patch to avoid conflicts. (That's why I
send this patch, not from mattn.)

Regards,
Ken Takata

-- 
-- 
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.
# HG changeset patch
# Parent  c935d6f6b4e4d54118405f3fb559ca41271c296c

diff --git a/src/terminal.c b/src/terminal.c
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -1247,6 +1247,7 @@ term_and_job_init(term_T *term, int rows
     job->jv_proc_info.dwProcessId = GetProcessId(child_process_handle);
     job->jv_job_object = jo;
     job->jv_status = JOB_STARTED;
+    ++job->jv_refcount;
     term->tl_job = job;
 
     vim_free(p);
@@ -1328,6 +1329,8 @@ term_and_job_init(term_T *term, int rows
     argvars[0].vval.v_string = cmd;
     setup_job_options(&opt, rows, cols);
     term->tl_job = job_start(argvars, &opt);
+    if (term->tl_job != NULL)
+	++term->tl_job->jv_refcount;
 
     return term->tl_job != NULL
 	&& term->tl_job->jv_channel != NULL

Raspunde prin e-mail lui