mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-23 15:06:32 +00:00
Set general global handle for extension registration work
* When calling the register() function there is no frame or globals, so we need to set an internal handle external to that. * This means functions that get wrapped know that there's a global handler for exceptions, which just prints to the log. Otherwise they think they're running synchronously and write to an invalid exception handling object.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
|
||||
// this is defined elsewhere for managing the opaque global_handle object
|
||||
extern "C" PyThreadState *GetExecutingThreadState(PyObject *global_handle);
|
||||
extern "C" PyObject *GetCurrentGlobalHandle();
|
||||
extern "C" void HandleException(PyObject *global_handle);
|
||||
extern "C" bool IsThreadBlocking(PyObject *global_handle);
|
||||
extern "C" void SetThreadBlocking(PyObject *global_handle, bool block);
|
||||
@@ -249,6 +250,9 @@ funcType ConvertFunc(const char *funcname, PyObject *func, ExceptionHandling &ex
|
||||
}
|
||||
}
|
||||
|
||||
if(!global_internal_handle)
|
||||
global_internal_handle = GetCurrentGlobalHandle();
|
||||
|
||||
// create a copy that will keep the function object alive as long as the lambda is
|
||||
PyObjectRefCounter funcptr(func);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user