Skip to content

Commit d50dccb

Browse files
committed
Go back to dlclose
1 parent 43cdad2 commit d50dccb

4 files changed

Lines changed: 8 additions & 12 deletions

File tree

extern/HighsExtrasApi.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ HIGHS_EXTRAS_API bool HighsExtras_getApi(HighsExtrasApi* api) {
7272
std::make_tuple(&Highs_amd_defaults, &Highs_amd_order));
7373

7474
bind_api<blas_methods>(
75-
api, std::make_tuple(
76-
&cblas_daxpy, &cblas_dcopy, &cblas_dscal, &cblas_dswap,
77-
&cblas_dgemv, &cblas_dtpsv, &cblas_dtrsv, &cblas_dger,
78-
&cblas_dgemm, &cblas_dsyrk, &cblas_dtrsm,
79-
&highs_openblas_set_num_threads));
75+
api,
76+
std::make_tuple(&cblas_daxpy, &cblas_dcopy, &cblas_dscal, &cblas_dswap,
77+
&cblas_dgemv, &cblas_dtpsv, &cblas_dtrsv, &cblas_dger,
78+
&cblas_dgemm, &cblas_dsyrk, &cblas_dtrsm,
79+
&highs_openblas_set_num_threads));
8080

8181
bind_api<metis_methods>(api, std::make_tuple(&Highs_METIS_SetDefaultOptions,
8282
&Highs_METIS_NodeND));

highs/HighsExternalApi.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
#include <mutex>
1515
using namespace HighsExtras;
1616

17-
HighsExternalApi::~HighsExternalApi() { unload(); }
18-
1917
HighsExternalApi& HighsExternalApi::instance() {
2018
static HighsExternalApi _instance;
2119
return _instance;

highs/HighsExternalApi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ struct trait_pack_ops<Trait, Rest...> {
119119
struct HighsExternalApi {
120120
public:
121121
HighsExternalApi() = default;
122-
~HighsExternalApi();
122+
~HighsExternalApi() { unload(); }
123123

124124
// Prevent copying
125125
HighsExternalApi(const HighsExternalApi&) = delete;

highs/util/HighsDynamicLibrary.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
#include "util/HighsDynamicLibrary.h"
1313

14-
#include "HConfig.h"
15-
1614
#if defined(_WIN32) || defined(_WIN64)
1715
#ifndef WIN32_LEAN_AND_MEAN
1816
#define WIN32_LEAN_AND_MEAN
@@ -68,9 +66,9 @@ void HighsDynamicLibrary::unload() {
6866
if (!handle_) return;
6967

7068
#if defined(_WIN32) || defined(_WIN64)
71-
// FreeLibrary(static_cast<HMODULE>(handle_));
69+
FreeLibrary(static_cast<HMODULE>(handle_));
7270
#else
73-
// dlclose(handle_);
71+
dlclose(handle_);
7472
#endif
7573

7674
handle_ = nullptr;

0 commit comments

Comments
 (0)