VirtualBox

Changeset 47369 in vbox


Ignore:
Timestamp:
Jul 24, 2013 12:35:14 PM (11 years ago)
Author:
vboxsync
Message:

Reverted r87514 + r87515: Not needed since -fexceptions is not specified atm.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/ptr.h

    r47368 r47369  
    4242#else
    4343 #include <nsISupportsUtils.h>
     44
    4445#endif /* !defined (VBOX_WITH_XPCOM) */
    4546
    46 #include <new> /* For bad_alloc. */
    4747#include <VBox/com/defs.h>
    4848
     
    463463    HRESULT createObject()
    464464    {
    465         HRESULT hr;
    466         try
     465        HRESULT rc;
     466#if !defined (VBOX_WITH_XPCOM)
     467#   ifdef VBOX_COM_OUTOFPROC_MODULE
     468        CComObjectNoLock<T> *obj = new CComObjectNoLock<T>();
     469        if (obj)
    467470        {
    468 #if !defined (VBOX_WITH_XPCOM)
    469 # ifdef VBOX_COM_OUTOFPROC_MODULE
    470             CComObjectNoLock<T> *obj = new CComObjectNoLock<T>();
    471471            obj->InternalFinalConstructAddRef();
    472             hr = obj->FinalConstruct();
     472            rc = obj->FinalConstruct();
    473473            obj->InternalFinalConstructRelease();
    474 # else
    475             CComObject<T> *obj = NULL;
    476             hr = CComObject<T>::CreateInstance(&obj);
    477 # endif
     474        }
     475        else
     476            rc = E_OUTOFMEMORY;
     477#   else
     478        CComObject<T> *obj = NULL;
     479        rc = CComObject<T>::CreateInstance(&obj);
     480#   endif
    478481#else /* !defined (VBOX_WITH_XPCOM) */
    479             CComObject<T> *obj = new CComObject<T>();
    480             hr = obj->FinalConstruct();
     482        CComObject<T> *obj = new CComObject<T>();
     483        if (obj)
     484            rc = obj->FinalConstruct();
     485        else
     486            rc = E_OUTOFMEMORY;
    481487#endif /* !defined (VBOX_WITH_XPCOM) */
    482             *this = obj;
    483         }
    484         catch(std::bad_alloc &)
    485         {
    486             hr = E_OUTOFMEMORY;
    487         }
    488 
    489         return hr;
     488        *this = obj;
     489        return rc;
    490490    }
    491491};
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