This repository was archived by the owner on Jan 12, 2024. It is now read-only.
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Consider inheriting from SafeHandle
in LlvmBindings native handle wrappers #1324
Open
Description
Several classes in LlvmBindings act as wrappers around native handles that need to be cleaned up by specific native calls on dispose of their wrappers. To get predictable behavior for closing the native handles on exceptions and the like, it is usually recommended to inherit from the SafeHandle class and use it's patterns for management of handles. While the existing manual dispose pattern hasn't caused any problems yet (and matches the code in LLVMSharp we copied this from), it would be good to follow the language recommendation.