missing DECREF in WriteUnraisable
authorStefan Behnel <scoder@users.berlios.de>
Mon, 1 Sep 2008 11:30:13 +0000 (13:30 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Mon, 1 Sep 2008 11:30:13 +0000 (13:30 +0200)
Cython/Compiler/Nodes.py

index def2e02520b9aba45ff3b9e0f6226400c5987f34..890c658b32a15cf65e43a94f5dfa875ce1f6c2a9 100644 (file)
@@ -4579,9 +4579,12 @@ static void __Pyx_WriteUnraisable(const char *name) {
     ctx = PyUnicode_FromString(name);
     #endif
     __Pyx_ErrRestore(old_exc, old_val, old_tb);
-    if (!ctx)
-        ctx = Py_None;
-    PyErr_WriteUnraisable(ctx);
+    if (!ctx) {
+        PyErr_WriteUnraisable(Py_None);
+    } else {
+        PyErr_WriteUnraisable(ctx);
+        Py_DECREF(ctx);
+    }
 }
 """]