stoddard 00/01/27 20:22:01
Modified: src/lib/apr/lib apr_pools.c src/lib/apr/threadproc/win32 proc.c Log: Fix bug in Win32 ap_get_os_proc() (it was already fixed in the Unix side...). Close process handle in free_proc_chain. Revision Changes Path 1.31 +9 -6 apache-2.0/src/lib/apr/lib/apr_pools.c Index: apr_pools.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/lib/apr_pools.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- apr_pools.c 2000/01/28 03:10:52 1.30 +++ apr_pools.c 2000/01/28 04:21:55 1.31 @@ -1310,13 +1310,16 @@ } } #ifdef WIN32 - /* Humm, still trying to understand what to do about this. + /* * Do we need an APR function to clean-up a proc_t? - * We have a handle leak here until this is fixed. - for (p = procs; p; p = p->next) { - CloseHandle(p->pid->pi.hProcess); - } - */ + */ + { + PROCESS_INFORMATION pi; + for (p = procs; p; p = p->next) { + ap_get_os_proc(&pi, p->pid); + CloseHandle(pi.hProcess); + } + } #endif /* WIN32 */ /* Now wait for all the signaled processes to die */ 1.16 +2 -3 apache-2.0/src/lib/apr/threadproc/win32/proc.c Index: proc.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/win32/proc.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- proc.c 2000/01/28 02:24:15 1.15 +++ proc.c 2000/01/28 04:21:59 1.16 @@ -105,7 +105,7 @@ attr->cntxt)) != APR_SUCCESS) { return stat; } - } + } if (err) { if ((stat = ap_create_pipe(&attr->parent_err, &attr->child_err, attr->cntxt)) != APR_SUCCESS) { @@ -122,7 +122,6 @@ ap_status_t ap_setprocattr_childout(struct procattr_t *attr, ap_file_t *child_out, ap_file_t *parent_out) { - if (attr->child_out == NULL && attr->parent_out == NULL) ap_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); @@ -451,7 +450,7 @@ if (proc == NULL) { return APR_ENOPROC; } - theproc = &(proc->pi); + *theproc = proc->pi; return APR_SUCCESS; }