Skip to content

Commit

Permalink
Refactor cancellation
Browse files Browse the repository at this point in the history
  • Loading branch information
Giorgi committed Jul 21, 2024
1 parent fe02f4c commit 873be2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions DuckDB.NET.Bindings/DuckDBWrapperObjects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ protected override bool ReleaseHandle()
NativeMethods.Startup.DuckDBDisconnect(out handle);
return true;
}

public void Interrupt()
{
NativeMethods.Startup.DuckDBInterrupt(handle);
}
}

public class DuckDBPreparedStatement() : SafeHandleZeroOrMinusOneIsInvalid(true)
Expand Down
2 changes: 1 addition & 1 deletion DuckDB.NET.Data/DuckDBCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public override void Cancel()
{
if (connection != null)
{
NativeMethods.Startup.DuckDBInterrupt(connection.NativeConnection.DangerousGetHandle());
connection.NativeConnection.Interrupt();
}
}

Expand Down

0 comments on commit 873be2b

Please sign in to comment.