Commit 1c7ade52 authored by Antoine Pitrou's avatar Antoine Pitrou

Fix leaking a RuntimeError objects when creating sub-interpreters

parent 2fabface
...@@ -2093,6 +2093,7 @@ _PyExc_Init(void) ...@@ -2093,6 +2093,7 @@ _PyExc_Init(void)
preallocate_memerrors(); preallocate_memerrors();
if (!PyExc_RecursionErrorInst) {
PyExc_RecursionErrorInst = BaseException_new(&_PyExc_RuntimeError, NULL, NULL); PyExc_RecursionErrorInst = BaseException_new(&_PyExc_RuntimeError, NULL, NULL);
if (!PyExc_RecursionErrorInst) if (!PyExc_RecursionErrorInst)
Py_FatalError("Cannot pre-allocate RuntimeError instance for " Py_FatalError("Cannot pre-allocate RuntimeError instance for "
...@@ -2115,6 +2116,7 @@ _PyExc_Init(void) ...@@ -2115,6 +2116,7 @@ _PyExc_Init(void)
Py_FatalError("init of pre-allocated RuntimeError failed"); Py_FatalError("init of pre-allocated RuntimeError failed");
Py_DECREF(args_tuple); Py_DECREF(args_tuple);
} }
}
Py_DECREF(bltinmod); Py_DECREF(bltinmod);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment