VirtualBox

Ignore:
Timestamp:
Jul 6, 2021 10:46:54 AM (3 years ago)
Author:
vboxsync
Message:

Additions: X11: main: update service termination code, bugref:10032.

This commit attempts to call service pfnStop() callback first and
only then pfnTerm(). This is needed for graceful service termination
procedure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/main.cpp

    r86883 r90053  
    119119    if (RT_FAILURE(rc))
    120120        VBClLogFatalError("Failure while acquiring the global critical section, rc=%Rrc\n", rc);
    121     if (   g_Service.pDesc
    122         && g_Service.pDesc->pfnTerm)
    123         g_Service.pDesc->pfnTerm();
     121
     122    /* Try to gracefuly terminate a service. Service needs
     123     * to be stopped first and then terminated. */
     124    if (g_Service.pDesc)
     125    {
     126        if (g_Service.pDesc->pfnStop)
     127            g_Service.pDesc->pfnStop();
     128
     129        if (g_Service.pDesc->pfnTerm)
     130            g_Service.pDesc->pfnTerm();
     131    }
     132
    124133    if (g_szPidFile[0] && g_hPidFile)
    125134        VbglR3ClosePidFile(g_szPidFile, g_hPidFile);
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