Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/sphinx/source/refcount.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Here is an example of a normal ``PyObject`` creation and deallocation:
PyObject *pObj = NULL;

pObj = PyBytes_FromString("Hello world\n"); /* Object creation, ref count = 1. */
PyObject_Print(pLast, stdout, 0);
PyObject_Print(pObj, stdout, 0);
Py_DECREF(pObj); /* ref count becomes 0, object deallocated.
* Miss this step and you have a memory leak. */
}
Expand All @@ -64,7 +64,7 @@ Taking the above example of a normal ``PyObject`` creation and deallocation then
#include "Python.h"

void print_hello_world(void) {
PyObject *pObj = NULL:
PyObject *pObj = NULL;

pObj = PyBytes_FromString("Hello world\n"); /* Object creation, ref count = 1. */
PyObject_Print(pLast, stdout, 0);
Expand Down