VirtualBox

Changeset 37311 in vbox


Ignore:
Timestamp:
Jun 3, 2011 8:50:36 AM (14 years ago)
Author:
vboxsync
Message:

rtProcWinRemovePid: Don't forget to close the process handle.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/process-win.cpp

    r34708 r37311  
    204204
    205205/**
    206  * Removes a process from g_paProcesses.
     206 * Removes a process from g_paProcesses and closes the process handle.
    207207 *
    208208 * @param   pid                 The process to remove (pid).
     
    215215        if (g_paProcesses[i].pid == pid)
    216216        {
     217            HANDLE hProcess = g_paProcesses[i].hProcess;
     218
    217219            g_cProcesses--;
    218220            uint32_t cToMove = g_cProcesses - i;
    219221            if (cToMove)
    220222                memmove(&g_paProcesses[i], &g_paProcesses[i + 1], cToMove * sizeof(g_paProcesses[0]));
    221             break;
     223
     224            RTCritSectLeave(&g_CritSect);
     225            CloseHandle(hProcess);
     226            return;
    222227        }
    223228    RTCritSectLeave(&g_CritSect);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette