Skip to content

Commit 61393ad

Browse files
committed
fix traceback refleak
1 parent fdf22f1 commit 61393ad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/error.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const char *python_error::what() const noexcept {
111111

112112
buf.put("Traceback (most recent call last):\n");
113113
for (auto it = frames.rbegin(); it != frames.rend(); ++it) {
114-
PyFrameObject *frame = *it;
114+
frame = *it;
115115
#if PY_VERSION_HEX >= 0x03090000
116116
PyCodeObject *f_code = PyFrame_GetCode(frame);
117117
#else
@@ -127,6 +127,7 @@ const char *python_error::what() const noexcept {
127127
#if PY_VERSION_HEX >= 0x03090000
128128
Py_DECREF(f_code);
129129
#endif
130+
Py_DECREF(frame);
130131
}
131132
}
132133

0 commit comments

Comments
 (0)