From 39c31e3b1bc262000ed9d1f35b99c8b45c13f1b7 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Thu, 16 Apr 2020 10:25:12 -0700 Subject: [PATCH] Update ReleaseHandle to check return values --- .../Storage/SQLite/v1/Interop/SafeSqliteBlobHandle.cs | 4 ++-- .../Portable/Storage/SQLite/v1/Interop/SafeSqliteHandle.cs | 4 ++-- .../Storage/SQLite/v1/Interop/SafeSqliteStatementHandle.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Workspaces/Core/Portable/Storage/SQLite/v1/Interop/SafeSqliteBlobHandle.cs b/src/Workspaces/Core/Portable/Storage/SQLite/v1/Interop/SafeSqliteBlobHandle.cs index c450dd859febc..2f5bff1e7e5ea 100644 --- a/src/Workspaces/Core/Portable/Storage/SQLite/v1/Interop/SafeSqliteBlobHandle.cs +++ b/src/Workspaces/Core/Portable/Storage/SQLite/v1/Interop/SafeSqliteBlobHandle.cs @@ -18,8 +18,8 @@ public SafeSqliteBlobHandle(SafeSqliteHandle sqliteHandle, sqlite3_blob? wrapper protected override bool ReleaseChildHandle() { - raw.sqlite3_blob_close(Wrapper); - return true; + var result = (Result)raw.sqlite3_blob_close(Wrapper); + return result == Result.OK; } } } diff --git a/src/Workspaces/Core/Portable/Storage/SQLite/v1/Interop/SafeSqliteHandle.cs b/src/Workspaces/Core/Portable/Storage/SQLite/v1/Interop/SafeSqliteHandle.cs index 512fd3a3d5483..476f590aaa5da 100644 --- a/src/Workspaces/Core/Portable/Storage/SQLite/v1/Interop/SafeSqliteHandle.cs +++ b/src/Workspaces/Core/Portable/Storage/SQLite/v1/Interop/SafeSqliteHandle.cs @@ -18,8 +18,8 @@ public SafeSqliteHandle(sqlite3? wrapper) protected override bool ReleaseHandle() { - raw.sqlite3_close(Wrapper); - return true; + var result = (Result)raw.sqlite3_close(Wrapper); + return result == Result.OK; } } } diff --git a/src/Workspaces/Core/Portable/Storage/SQLite/v1/Interop/SafeSqliteStatementHandle.cs b/src/Workspaces/Core/Portable/Storage/SQLite/v1/Interop/SafeSqliteStatementHandle.cs index 54131c6791826..c974c2c02be1d 100644 --- a/src/Workspaces/Core/Portable/Storage/SQLite/v1/Interop/SafeSqliteStatementHandle.cs +++ b/src/Workspaces/Core/Portable/Storage/SQLite/v1/Interop/SafeSqliteStatementHandle.cs @@ -18,8 +18,8 @@ public SafeSqliteStatementHandle(SafeSqliteHandle sqliteHandle, sqlite3_stmt? wr protected override bool ReleaseChildHandle() { - raw.sqlite3_finalize(Wrapper); - return true; + var result = (Result)raw.sqlite3_finalize(Wrapper); + return result == Result.OK; } } }