From 4d40723c19391b27b64d5a1d9d2c5df8c15ff52d Mon Sep 17 00:00:00 2001 From: Gowa2017 Date: Wed, 5 Apr 2023 01:04:18 +0800 Subject: [PATCH 1/2] OpenSession need a pointer of pointer --- src/sdf/sdf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdf/sdf.c b/src/sdf/sdf.c index ee186c4fb..183b3bad7 100755 --- a/src/sdf/sdf.c +++ b/src/sdf/sdf.c @@ -103,7 +103,7 @@ int sdf_print_device_info(FILE *fp, int fmt, int ind, const char *lable, SDF_DEV void *hSession = NULL; DEVICEINFO devInfo; - if (SDF_OpenSession(dev->handle, hSession) != SDR_OK + if (SDF_OpenSession(dev->handle, &hSession) != SDR_OK || SDF_GetDeviceInfo(hSession, &devInfo) != SDR_OK) { error_print(); goto end; From 4722f5386959b860a0606a63dc34ce4a9cf84346 Mon Sep 17 00:00:00 2001 From: Gowa2017 Date: Thu, 20 Apr 2023 22:05:51 +0800 Subject: [PATCH 2/2] fix: use dylib_close_library, not free to close dynamic lib --- src/sdf/sdf_meth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdf/sdf_meth.c b/src/sdf/sdf_meth.c index 44b87e68f..e4b77a38d 100755 --- a/src/sdf/sdf_meth.c +++ b/src/sdf/sdf_meth.c @@ -97,7 +97,7 @@ SDF_METHOD *SDF_METHOD_load_library(const char *so_path) void SDF_METHOD_free(SDF_METHOD *meth) { - if (meth) free(meth->dso); + if (meth) dylib_close_library(meth->dso); free(meth); }