VirtualBox

Changeset 49610 in vbox


Ignore:
Timestamp:
Nov 21, 2013 4:01:00 PM (11 years ago)
Author:
vboxsync
Message:

Main/GuestCtrl: Don't keep ComObjPtr of parents in internal listeners.

Location:
trunk/src/VBox/Main/src-client
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestFileImpl.cpp

    r49504 r49610  
    5757    HRESULT init(GuestFile *pFile)
    5858    {
     59        AssertPtrReturn(pFile, E_POINTER);
    5960        mFile = pFile;
    6061        return S_OK;
     
    6364    void uninit(void)
    6465    {
    65         mFile.setNull();
     66        mFile = NULL;
    6667    }
    6768
     
    7576            case VBoxEventType_OnGuestFileWrite:
    7677            {
    77                 Assert(!mFile.isNull());
     78                AssertPtrReturn(mFile, E_POINTER);
    7879                int rc2 = mFile->signalWaitEvent(aType, aEvent);
    7980#ifdef DEBUG_andy
     
    9495private:
    9596
    96     ComObjPtr<GuestFile> mFile;
     97    GuestFile *mFile;
    9798};
    9899typedef ListenerImpl<GuestFileListener, GuestFile*> GuestFileListenerImpl;
     
    703704
    704705/**
    705  * Called by IGuestSession right before this file gets removed 
    706  * from the public file list. 
     706 * Called by IGuestSession right before this file gets removed
     707 * from the public file list.
    707708 */
    708709int GuestFile::onRemove(void)
     
    714715    int vrc = VINF_SUCCESS;
    715716
    716     /* 
     717    /*
    717718     * Note: The event source stuff holds references to this object,
    718719     *       so make sure that this is cleaned up *before* calling uninit().
  • trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp

    r49570 r49610  
    9797    HRESULT init(GuestProcess *pProcess)
    9898    {
     99        AssertPtrReturn(pProcess, E_POINTER);
    99100        mProcess = pProcess;
    100101        return S_OK;
     
    103104    void uninit(void)
    104105    {
    105         mProcess.setNull();
     106        mProcess = NULL;
    106107    }
    107108
     
    114115            case VBoxEventType_OnGuestProcessOutput:
    115116            {
    116                 Assert(!mProcess.isNull());
     117                AssertPtrReturn(mProcess, E_POINTER);
    117118                int rc2 = mProcess->signalWaitEvent(aType, aEvent);
    118119#ifdef DEBUG
     
    133134private:
    134135
    135     ComObjPtr<GuestProcess> mProcess;
     136    GuestProcess *mProcess;
    136137};
    137138typedef ListenerImpl<GuestProcessListener, GuestProcess*> GuestProcessListenerImpl;
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r49570 r49610  
    9797    HRESULT init(GuestSession *pSession)
    9898    {
     99        AssertPtrReturn(pSession, E_POINTER);
    99100        mSession = pSession;
    100101        return S_OK;
     
    103104    void uninit(void)
    104105    {
    105         mSession.setNull();
     106        mSession = NULL;
    106107    }
    107108
     
    112113            case VBoxEventType_OnGuestSessionStateChanged:
    113114            {
    114                 Assert(!mSession.isNull());
     115                AssertPtrReturn(mSession, E_POINTER);
    115116                int rc2 = mSession->signalWaitEvent(aType, aEvent);
    116117#ifdef DEBUG_andy
     
    131132private:
    132133
    133     ComObjPtr<GuestSession> mSession;
     134    GuestSession *mSession;
    134135};
    135136typedef ListenerImpl<GuestSessionListener, GuestSession*> GuestSessionListenerImpl;
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