Skip to content

Commit 87a4bde

Browse files
committed
minor: Re-org Py_INCREF on InstanceHashes to make more sense
1 parent 20bb235 commit 87a4bde

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/python.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,6 @@ getCacheEntry(Oid foreigntableid)
667667
MemoryContextDelete(tempContext);
668668
}
669669
RelationClose(rel);
670-
Py_INCREF(entry->value);
671670

672671
/*
673672
* Start a new transaction or subtransaction if needed.
@@ -685,7 +684,9 @@ getCacheEntry(Oid foreigntableid)
685684
PyObject *
686685
getInstance(Oid foreigntableid)
687686
{
688-
return getCacheEntry(foreigntableid)->value;
687+
PyObject* retval = getCacheEntry(foreigntableid)->value;
688+
Py_INCREF(retval);
689+
return retval;
689690
}
690691

691692

0 commit comments

Comments
 (0)