Skip to content

Commit 980ca0c

Browse files
msimaceksteve-s
authored andcommitted
Remove pointer from nativeLookup when releasing replacement wrapper memory
1 parent cf238cd commit 980ca0c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/PyTruffleObjectFree.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@
4444

4545
import com.oracle.graal.python.builtins.objects.cext.capi.CExtNodes.ClearNativeWrapperNode;
4646
import com.oracle.graal.python.builtins.objects.cext.capi.CExtNodes.PCallCapiFunction;
47+
import com.oracle.graal.python.builtins.objects.cext.capi.transitions.CApiTransitions;
4748
import com.oracle.graal.python.builtins.objects.cext.capi.transitions.CApiTransitions.HandlePointerConverter;
4849
import com.oracle.graal.python.builtins.objects.cext.capi.transitions.CApiTransitions.HandleReleaser;
4950
import com.oracle.graal.python.builtins.objects.cext.common.CArrayWrappers.CArrayWrapper;
51+
import com.oracle.graal.python.runtime.PythonContext;
5052
import com.oracle.graal.python.util.PythonUtils;
5153
import com.oracle.truffle.api.TruffleLogger;
5254
import com.oracle.truffle.api.dsl.Cached;
@@ -117,6 +119,7 @@ static void doNativeWrapper(PythonNativeWrapper nativeWrapper,
117119
if (HandlePointerConverter.pointsToPyHandleSpace(nativePointer)) {
118120
HandleReleaser.release(nativePointer);
119121
} else {
122+
CApiTransitions.nativeLookupRemove(PythonContext.get(callReleaseHandleNode).nativeContext, nativePointer);
120123
callReleaseHandleNode.call(NativeCAPISymbol.FUN_PY_TRUFFLE_FREE, nativePointer);
121124
}
122125
}

0 commit comments

Comments
 (0)