Thanks Robert. I ended up letting Python handle the memory management. In my C-extension I just call Py_INCREF to prevent Python from deallocating it while I'm using it. I then call Py_DECREF once I'm done with it. Jeremy