summaryrefslogtreecommitdiff
path: root/msgpack/unpack_template.h
diff options
context:
space:
mode:
authorINADA Naoki <songofacandy@gmail.com>2015-11-08 12:38:38 +0900
committerINADA Naoki <songofacandy@gmail.com>2015-11-08 12:43:54 +0900
commit35a69ac9c2fbf6b68b970352791f6d98fbd74963 (patch)
treefc571cccadcbc5a6e30b2d70f8de24eb9c7aec8f /msgpack/unpack_template.h
parenta329850147e045ca990c1ff870ce191c4efa4d06 (diff)
downloadmsgpack-python-35a69ac9c2fbf6b68b970352791f6d98fbd74963.tar.gz
Decrease refcnt when error happend while unpacking
Fixes #152
Diffstat (limited to 'msgpack/unpack_template.h')
-rw-r--r--msgpack/unpack_template.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/msgpack/unpack_template.h b/msgpack/unpack_template.h
index 5b389b8..6b83d3e 100644
--- a/msgpack/unpack_template.h
+++ b/msgpack/unpack_template.h
@@ -70,6 +70,10 @@ static inline PyObject* unpack_data(unpack_context* ctx)
return (ctx)->stack[0].obj;
}
+static inline PyObject* unpack_clear(unpack_context *ctx)
+{
+ Py_CLEAR(ctx->stack[0].obj);
+}
template <bool construct>
static inline int unpack_execute(unpack_context* ctx, const char* data, Py_ssize_t len, Py_ssize_t* off)