static void release_QTcpSocket(void *sipCppV,int) { QTcpSocket *sipCpp = reinterpret_cast<QTcpSocket *>(sipCppV); Py_BEGIN_ALLOW_THREADS if (QThread::currentThread() == sipCpp->thread()) delete sipCpp; else sipCpp->deleteLater(); Py_END_ALLOW_THREADS }