VirtualBox

Changeset 90631 in vbox for trunk/src/libs


Ignore:
Timestamp:
Aug 11, 2021 4:19:05 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146243
Message:

libs/XPCOM: Just use PyObject_Init() everywhere (also for Python < 3.9) instead of _Py_NewReference(). bugref:10079

Location:
trunk/src/libs/xpcom18a4/python/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/python/src/PyIID.cpp

    r90630 r90631  
    266266        ob_type = GetTypeObject();
    267267#endif
    268 #if PY_VERSION_HEX >= 0x03090000 /* VBox: Needed for 3.9 and up, includes _Py_NewReferences. @bugref{10079} */ /** @todo do this for older pythons too?  We probably really should for Py_LIMITED_API builds... */
    269         PyObject_Init(this, ob_type);
    270 #else
    271         _Py_NewReference(this);
    272 #endif
     268        PyObject_Init(this, ob_type); /* VBox: Needed for 3.9 and up (also works on Python 2.7), includes _Py_NewReferences. @bugref{10079} */
    273269
    274270        m_iid = riid;
  • trunk/src/libs/xpcom18a4/python/src/PyISupports.cpp

    r90630 r90631  
    146146        PR_AtomicIncrement(&cInterfaces);
    147147        PyXPCOM_DLLAddRef();
    148 #if PY_VERSION_HEX >= 0x03090000 /* VBox: Needed for 3.9 and up, includes _Py_NewReferences. @bugref{10079} */ /** @todo do this for older pythons too?  We probably really should for Py_LIMITED_API builds... */
    149         PyObject_Init(this, ob_type);
    150 #else
    151         _Py_NewReference(this);
    152 #endif
     148        PyObject_Init(this, ob_type); /* VBox: Needed for 3.9 and up (also works on Python 2.7), includes _Py_NewReferences. @bugref{10079} */
    153149
    154150#ifdef VBOX_DEBUG_LIFETIMES
  • trunk/src/libs/xpcom18a4/python/src/TypeObject.cpp

    r90630 r90631  
    435435        /* Initialize the PyObject part - needed so we can keep instance in a PyDict: */
    436436        ob_type = PyXPCOM_GetInterfaceType();
    437 # if PY_VERSION_HEX >= 0x03090000 /* VBox: Needed for 3.9 and up, includes _Py_NewReferences. @bugref{10079} */ /** @todo do this for older pythons too?  We probably really should for Py_LIMITED_API builds... */
    438         PyObject_Init(this, ob_type);
    439 # else
    440         _Py_NewReference(this);
    441 # endif
     437        PyObject_Init(this, ob_type); /* VBox: Needed for 3.9 and up (also works on Python 2.7), includes _Py_NewReferences. @bugref{10079} */
    442438
    443439#endif /* Py_LIMITED_API */
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