VirtualBox

Changeset 90630 in vbox for trunk/src/libs/xpcom18a4/python


Ignore:
Timestamp:
Aug 11, 2021 2:40:33 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146242
Message:

xpcom/python: It's either PyObject_Init or _Py_NewReference, we should skip the latter even for older releases. bugref:10079

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

Legend:

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

    r90623 r90630  
    266266        ob_type = GetTypeObject();
    267267#endif
    268 #if defined(Py_TRACE_REFS) || PY_VERSION_HEX < 0x03090000 /* VBox: Removed in 3.9, harmless. @bugref{10079} */
     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
    269271        _Py_NewReference(this);
    270 #endif
    271 #if PY_VERSION_HEX >= 0x03090000 /* VBox: Needed for 3.9 and up. @bugref{10079} */
    272     PyObject_Init(this, ob_type);
    273272#endif
    274273
  • trunk/src/libs/xpcom18a4/python/src/PyISupports.cpp

    r90623 r90630  
    146146        PR_AtomicIncrement(&cInterfaces);
    147147        PyXPCOM_DLLAddRef();
    148 #if defined(Py_TRACE_REFS) || PY_VERSION_HEX < 0x03090000 /* VBox: Removed in 3.9, harmless. @bugref{10079} */
     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
    149151        _Py_NewReference(this);
    150 #endif
    151 #if PY_VERSION_HEX >= 0x03090000 /* VBox: Needed for 3.9 and up. @bugref{10079} */
    152     PyObject_Init(this, ob_type);
    153152#endif
    154153
  • trunk/src/libs/xpcom18a4/python/src/TypeObject.cpp

    r90623 r90630  
    435435        /* Initialize the PyObject part - needed so we can keep instance in a PyDict: */
    436436        ob_type = PyXPCOM_GetInterfaceType();
    437 # if defined(Py_TRACE_REFS) || PY_VERSION_HEX < 0x03090000 /* VBox: Removed in 3.9, harmless. @bugref{10079} */
     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
    438440        _Py_NewReference(this);
    439 # endif
    440 # if PY_VERSION_HEX >= 0x03090000 /* VBox: Needed for 3.9 and up. @bugref{10079} */
    441     PyObject_Init(this, ob_type);
    442441# endif
    443442
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