Skip to content
Snippets Groups Projects
Commit 2f0e395f authored by Wim Lavrijsen's avatar Wim Lavrijsen
Browse files
git-svn-id: http://root.cern.ch/svn/root/trunk@37462 27541ba8-7e3a-0410-8455-c3a389f83636
parent fcbdb92c
No related branches found
No related tags found
No related merge requests found
......@@ -92,6 +92,15 @@ namespace {
((ObjectProxy*)result)->HoldOn();
}
// if this new object falls inside self, make sure its lifetime is proper
if ( pymeth->fSelf && ObjectProxy_Check( result ) ) {
Long_t ptrdiff = (Long_t)((ObjectProxy*)result)->GetObject() - (Long_t)pymeth->fSelf->GetObject();
if ( 0 <= ptrdiff && ptrdiff < (Long_t)pymeth->fSelf->ObjectIsA()->Size() ) {
if ( PyObject_SetAttr( result, PyStrings::gLifeLine, (PyObject*)pymeth->fSelf ) == -1 )
PyErr_Clear(); // ignored
}
}
return result;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment