mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-29 10:05:44 +00:00
Use m_DeferredInit to guard waiting in python calls that need reflector
This commit is contained in:
1 file changed
+8
-5
@@ -1767,14 +1767,16 @@ QWidget *PythonContext::QWidgetFromPy(PyObject *widget)
|
||||
|
||||
void PythonContext::reflectSource(QString src)
|
||||
{
|
||||
if(!m_Reflector)
|
||||
if(m_DeferredInit == 0)
|
||||
{
|
||||
for(int i = 0; i < 50 && m_DeferredInit == 0; i++)
|
||||
QThread::msleep(20);
|
||||
m_DeferredInit = 1;
|
||||
|
||||
if(!m_Reflector)
|
||||
{
|
||||
m_DeferredInit = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
PyGILState_STATE gil = PyGILState_Ensure();
|
||||
@@ -1799,15 +1801,16 @@ void PythonContext::reflectSource(QString src)
|
||||
void PythonContext::makeHelpContext()
|
||||
{
|
||||
// expand out members of renderdoc and qrenderdoc using the stubs
|
||||
if(!m_StubRD || !m_StubQRD)
|
||||
if(m_DeferredInit == 0)
|
||||
{
|
||||
for(int i = 0; i < 50 && m_DeferredInit == 0; i++)
|
||||
QThread::msleep(20);
|
||||
|
||||
m_DeferredInit = 1;
|
||||
|
||||
if(!m_StubRD || !m_StubQRD)
|
||||
{
|
||||
m_DeferredInit = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
PyGILState_STATE gil = PyGILState_Ensure();
|
||||
|
||||
Reference in new issue
Block a user