Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Ubiquity.NET.Llvm/BitcodeModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ public void Dispose( )
// finalizer, which would cause an access violation in the native LLVM layer.
if( !IsDisposed )
{
// DI builder is owned by this module, so when it is destroyed so is the builder
if(LazyDiBuilder.IsValueCreated)
{
LazyDiBuilder.Value.BuilderHandle.SetHandleAsInvalid();
}

// remove the module handle from the module cache.
ModuleHandle!.Dispose( );
ModuleHandle = default;
Expand Down
Loading