swiftlang / swift-java

Apache License 2.0
724 stars 27 forks source link

Invalidate Java wrapper when we destroy() an underlying swift instance #85

Open ktoso opened 1 month ago

ktoso commented 1 month ago

We should invalidate wrapper types when we destroy the underlying Swift memory.

This is done in SwiftMemoryResourceCleanup.java

We should zero out the pointer or something else, such that we can prevent use-after-free from the Java side reaching into Swift destroyed objects.