changeset 1461:76bb2998b190

Fixed decrefing of wrong object.
author Marcel Keller <mkeller@cs.au.dk>
date Tue, 27 Jul 2010 20:52:21 +0200
parents 8e1b50599848
children 47386d89e4fc
files viff/cdefer.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/viff/cdefer.c	Mon Jul 26 21:14:12 2010 +0200
+++ b/viff/cdefer.c	Tue Jul 27 20:52:21 2010 +0200
@@ -675,7 +675,8 @@
 
 		// self->result might be replaced and thus decref'd
 		// while running its callback.
-		Py_INCREF(self->result);
+		tmp = self->result;
+		Py_INCREF(tmp);
                 result = cdefer_Deferred__addCallbacks(
                     (cdefer_Deferred *)self->result, _continue,
                     _continue, Py_None, Py_None, Py_None, Py_None);
@@ -683,7 +684,7 @@
                  * (when errored) in addCallbacks, either way, we own
                  * one too, and don't need it anymore. */
                 Py_DECREF(_continue);
-		Py_DECREF(self->result);
+		Py_DECREF(tmp);
 
                 if (!result) {
                     return NULL;