VirtualBox

Changeset 49389 in vbox


Ignore:
Timestamp:
Nov 5, 2013 1:32:12 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
90435
Message:

GuestCtrl: Main/VBoxManage: More checks for object pointers, minor logging adjustments.

Location:
trunk/src/VBox
Files:
5 edited

Legend:

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

    r49353 r49389  
    6767/** Our global session object which is also used in the
    6868 *  signal handler to abort operations properly. */
    69 static ComPtr<IGuestSession> g_pGuestSession;
     69static ComPtr<IGuestSession> g_pGuestSession = NULL;
    7070
    7171/**
     
    700700
    701701            pCtx->pGuestSession.setNull();
    702             g_pGuestSession.setNull();
    703         }
    704 
     702        }
     703
     704        g_pGuestSession.setNull();
    705705        if (pCtx->handlerArg.session)
    706706            CHECK_ERROR(pCtx->handlerArg.session, UnlockMachine());
     
    711711        RTStrFree(pCtx->ppaArgv[i]);
    712712    RTMemFree(pCtx->ppaArgv);
     713    pCtx->iArgc = 0;
    713714}
    714715
  • trunk/src/VBox/Main/src-client/GuestFileImpl.cpp

    r49349 r49389  
    108108HRESULT GuestFile::FinalConstruct(void)
    109109{
    110     LogFlowThisFunc(("\n"));
     110    LogFlowThisFuncEnter();
    111111    return BaseFinalConstruct();
    112112}
     
    225225void GuestFile::uninit(void)
    226226{
    227     LogFlowThisFunc(("\n"));
     227    LogFlowThisFuncEnter();
    228228
    229229    /* Enclose the state transition Ready->InUninit->NotReady. */
     
    235235    baseUninit();
    236236
    237     mEventSource->UnregisterListener(mLocalListener);
    238     unconst(mEventSource).setNull();
     237    if (!mEventSource.isNull())
     238    {
     239        mEventSource->UnregisterListener(mLocalListener);
     240
     241        mLocalListener.setNull();
     242        unconst(mEventSource).setNull();
     243    }
    239244#endif
    240245
  • trunk/src/VBox/Main/src-client/GuestImpl.cpp

    r47469 r49389  
    159159#ifdef DEBUG
    160160        ULONG cRefs = itSessions->second->AddRef();
    161         LogFlowThisFunc(("pSession=%p, cRefs=%RU32\n", (GuestSession *)itSessions->second, cRefs > 0 ? cRefs - 1 : 0));
     161        LogFlowThisFunc(("sessionID=%RU32, cRefs=%RU32\n", itSessions->first, cRefs > 1 ? cRefs - 1 : 0));
    162162        itSessions->second->Release();
    163163#endif
  • trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp

    r49350 r49389  
    279279    baseUninit();
    280280
    281     mEventSource->UnregisterListener(mLocalListener);
    282 
    283     mLocalListener.setNull();
    284     unconst(mEventSource).setNull();
     281    if (!mEventSource.isNull())
     282    {
     283        mEventSource->UnregisterListener(mLocalListener);
     284
     285        mLocalListener.setNull();
     286        unconst(mEventSource).setNull();
     287    }
    285288#endif
    286289
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r49359 r49389  
    145145HRESULT GuestSession::FinalConstruct(void)
    146146{
    147     LogFlowThisFunc(("\n"));
     147    LogFlowThisFuncEnter();
    148148    return BaseFinalConstruct();
    149149}
     
    315315    baseUninit();
    316316
    317     mEventSource->UnregisterListener(mLocalListener);
    318     unconst(mEventSource).setNull();
    319 
     317    if (!mEventSource.isNull())
     318    {
     319        mEventSource->UnregisterListener(mLocalListener);
     320
     321        mLocalListener.setNull();
     322        unconst(mEventSource).setNull();
     323    }
    320324#endif /* VBOX_WITH_GUEST_CONTROL */
    321325    LogFlowFuncLeaveRC(rc);
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