diff options
author | INADA Naoki <inada-n@klab.com> | 2014-02-13 09:58:38 +0900 |
---|---|---|
committer | INADA Naoki <inada-n@klab.com> | 2014-02-13 09:58:38 +0900 |
commit | 6d80569b9b7ec6f3756ecc91928e4ce127eb7a4b (patch) | |
tree | 7dff7a7c689f7aff384ac059361c742b7e02b5c5 /msgpack | |
parent | cf63f19211797261b117227f23066952efebca29 (diff) | |
download | msgpack-python-6d80569b9b7ec6f3756ecc91928e4ce127eb7a4b.tar.gz |
Unpacker: maintain refcnt (fix #67).
Diffstat (limited to 'msgpack')
-rw-r--r-- | msgpack/_unpacker.pyx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/msgpack/_unpacker.pyx b/msgpack/_unpacker.pyx index 16aca5c..0df6ab3 100644 --- a/msgpack/_unpacker.pyx +++ b/msgpack/_unpacker.pyx @@ -206,7 +206,8 @@ cdef class Unpacker(object): cdef object file_like cdef object file_like_read cdef Py_ssize_t read_size - cdef object object_hook + # To maintain refcnt. + cdef object object_hook, object_pairs_hook, list_hook cdef object encoding, unicode_errors cdef size_t max_buffer_size @@ -224,6 +225,10 @@ cdef class Unpacker(object): cdef char *cenc=NULL, cdef char *cerr=NULL + self.object_hook = object_hook + self.object_pairs_hook = object_pairs_hook + self.list_hook = list_hook + self.file_like = file_like if file_like: self.file_like_read = file_like.read |