Skip to content

Commit

Permalink
Document non-null return values
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Apr 16, 2020
1 parent 39c31e3 commit de40b56
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Workspaces/Core/Portable/Storage/SQLite/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public static SafeSqliteHandle sqlite3_open_v2(string filename, int flags, strin

try
{
// Always return a non-null handle to match default P/Invoke marshaling behavior. SafeHandle.IsInvalid
// will be true when the handle is not usable, but the handle instance can be disposed either way.
return new SafeSqliteHandle(wrapper);
}
catch
Expand All @@ -45,6 +47,8 @@ public static SafeSqliteStatementHandle sqlite3_prepare_v2(SafeSqliteHandle db,

try
{
// Always return a non-null handle to match default P/Invoke marshaling behavior. SafeHandle.IsInvalid
// will be true when the handle is not usable, but the handle instance can be disposed either way.
return new SafeSqliteStatementHandle(db, wrapper);
}
catch
Expand All @@ -66,6 +70,8 @@ public static SafeSqliteBlobHandle sqlite3_blob_open(SafeSqliteHandle db, string

try
{
// Always return a non-null handle to match default P/Invoke marshaling behavior. SafeHandle.IsInvalid
// will be true when the handle is not usable, but the handle instance can be disposed either way.
return new SafeSqliteBlobHandle(db, wrapper);
}
catch
Expand Down

0 comments on commit de40b56

Please sign in to comment.