json_true and incref()

20 views
Skip to first unread message

Paul Harris

unread,
May 31, 2012, 1:01:41 PM5/31/12
to jansso...@googlegroups.com
Hi,

The documentation doesn't explicitly state whether we need to worry about incref on json_true.
I would assume not, but is it going to cause trouble if I decref on json_true?

It would be nice if the documentation stated the case explicitly.

cheers,
Paul

Petri Lehtinen

unread,
Jun 1, 2012, 2:07:37 AM6/1/12
to jansso...@googlegroups.com
The true, false and null values are static singletons, so you don't
*have* to incref or decref them. Doing so is a good practice, though,
because that you don't forget it for other types. This is the reason
why the documentation doesn't speak about the special reference
counting for singletons.

Petri
Reply all
Reply to author
Forward
0 new messages