VirtualBox

Ignore:
Timestamp:
Oct 15, 2012 12:13:31 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
81387
Message:

Fe/VBoxManage: Close the session after execution usage. Todos.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp

    r43638 r43639  
    734734    }
    735735
     736    /** @todo This eventually needs a bit of revamping so that a valid session gets passed
     737     *        into this function already so that we don't need to mess around with closing
     738     *        the session all over the places below again. Later. */
     739
    736740    ComPtr<IGuestSession> pGuestSession;
    737741    rc = pGuest->CreateSession(Bstr(strUsername).raw(),
     
    762766    {
    763767        ctrlPrintError(pGuestSession, COM_IIDOF(IGuestSession));
     768
     769        pGuestSession->Close();
    764770        return RTEXITCODE_FAILURE;
    765771    }
     
    805811            {
    806812                ctrlPrintError(pProcess, COM_IIDOF(IProcess));
     813
     814                pGuestSession->Close();
    807815                return RTEXITCODE_FAILURE;
    808816            }
     
    819827                        {
    820828                            ctrlPrintError(pProcess, COM_IIDOF(IProcess));
     829
     830                            pGuestSession->Close();
    821831                            return RTEXITCODE_FAILURE;
    822832                        }
     
    875885            {
    876886                ctrlPrintError(pProcess, COM_IIDOF(IProcess));
     887
     888                pGuestSession->Close();
    877889                return RTEXITCODE_FAILURE;
    878890            }
     
    882894            {
    883895                ctrlPrintError(pProcess, COM_IIDOF(IProcess));
     896
     897                pGuestSession->Close();
    884898                return RTEXITCODE_FAILURE;
    885899            }
    886900            if (fVerbose)
    887901                RTPrintf("Exit code=%u (Status=%u [%s])\n", exitCode, status, ctrlExecProcessStatusToText(status));
     902
     903            pGuestSession->Close();
    888904            return ctrlExecProcessStatusToExitCode(status, exitCode);
    889905        }
     
    892908            if (fVerbose)
    893909                RTPrintf("Process execution aborted!\n");
     910
     911            pGuestSession->Close();
    894912            return EXITCODEEXEC_TERM_ABEND;
    895913        }
     
    26852703                 || !strcmp(pArg->argv[1], "updateadds"))
    26862704            rcExit = handleCtrlUpdateAdditions(guest, &arg);
     2705        /** @todo Implement a "sessions list" command to list all opened
     2706         *        guest sessions along with their (friendly) names. */
    26872707        else
    26882708            rcExit = errorSyntax(USAGE_GUESTCONTROL, "Unknown sub command '%s' specified!", pArg->argv[1]);
Note: See TracChangeset for help on using the changeset viewer.

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