mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Fix issue with iterating actions via previous/next in python
* We keep parent references when returning child objects via reference/python object wrappers rather than copying. But when iterating a linked list like the actions this can produce an incredibly long parent chain and then on destruction we can stack overflow if the chain is long enough.
This commit is contained in:
@@ -214,6 +214,21 @@ VA_IGNORE_REST_OF_FILE
|
||||
$1.assign(*$input);
|
||||
}
|
||||
|
||||
%typemap(ret) const ActionDescription * {
|
||||
// for ActionDescription pointers don't apply parent tracking, since these are preserved
|
||||
// in other ways and the linked-list nature of walking them can produce absurdly long
|
||||
// parent chains
|
||||
if (SwigPyObject_Check($result))
|
||||
{
|
||||
SwigPyObject *sobj = (SwigPyObject *)$result;
|
||||
if(sobj->parent)
|
||||
{
|
||||
sobj->parent = NULL;
|
||||
Py_DECREF($self);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SIMPLE_TYPEMAPS(rdcstr)
|
||||
SIMPLE_TYPEMAPS(rdcinflexiblestr)
|
||||
SIMPLE_TYPEMAPS(rdcdatetime)
|
||||
|
||||
Reference in New Issue
Block a user