From 1ba73059744e514188d49e52c00804dbd47d20a1 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Wed, 29 Jan 2014 23:18:58 +0000 Subject: PyTuple_SetItem steals a reference to the item it inserts in the tuple This, plus the Py_XDECREF of the tuple a few lines below, causes our session dictionary to go away after the first time a SWIG layer function is called - with disastrous effects for the first subsequent attempt to use any functionality in ScriptInterpreterPython This fixes it llvm-svn: 200429 --- lldb/scripts/Python/python-wrapper.swig | 1 + 1 file changed, 1 insertion(+) (limited to 'lldb/scripts/Python/python-wrapper.swig') diff --git a/lldb/scripts/Python/python-wrapper.swig b/lldb/scripts/Python/python-wrapper.swig index d28f0cda..75b082f 100644 --- a/lldb/scripts/Python/python-wrapper.swig +++ b/lldb/scripts/Python/python-wrapper.swig @@ -135,6 +135,7 @@ public: { if (!arg) return retval; + Py_INCREF(arg); // _SetItem steals a reference PyTuple_SetItem(pargs,idx,arg); idx++; } -- cgit v1.1