Skip to content
Closed
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
2 changes: 2 additions & 0 deletions cs/vw.net.native/vw.net.builders.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ API void DeleteBuilder(vw_net_native::builder_context* builder)
ex.is_newline = false;
}
}

delete builder;
}

API void BuilderPreallocate(vw_net_native::builder_context* builder, vw_net_native::dotnet_size_t size)
Expand Down
1 change: 1 addition & 0 deletions cs/vw.net.native/vw.net.workspace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ API vw_net_native::ERROR_CODE DeleteWorkspace(
try
{
VW::finish(*workspace->vw);
delete workspace;
return VW::experimental::error_code::success;
}
CATCH_RETURN_STATUS
Expand Down
2 changes: 2 additions & 0 deletions cs/vw.net/VowpalWabbitBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ private unsafe static New<VowpalWabbitBase> BindConstructorArguments(VowpalWabbi
IOReaderAdapter modelReader = new IOReaderAdapter(settings.ModelStream);

IntPtr result = NativeMethods.CreateWorkspaceWithModelData(new IntPtr(argumentsPtr), argumentsSize, modelReader.GetVTable(), traceListener, localTraceContext, localStatus.ToNativeHandleOrNullptrDangerous());
GC.KeepAlive(modelReader);

if (result == IntPtr.Zero || localStatus.ErrorCode != NativeMethods.SuccessStatus)
{
Expand Down Expand Up @@ -423,6 +424,7 @@ public void SaveModel(Stream stream)
IOWriterAdapter writer = new IOWriterAdapter(stream);
NativeMethods.WorkspaceSavePredictorToWriter(this.DangerousGetHandle(), writer.GetVTable(), status.ToNativeHandleOrNullptrDangerous());
GC.KeepAlive(this);
GC.KeepAlive(writer);

if (status.ErrorCode != NativeMethods.SuccessStatus)
{
Expand Down
Loading
Loading