File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -455,6 +455,25 @@ static void my_dlclose(void *library) {
455
455
#endif
456
456
}
457
457
458
+ static void my_dlclose_no_assert (void *library) {
459
+ #ifdef _WIN32
460
+ FreeLibrary ((HMODULE)library);
461
+ #else
462
+ dlclose (library);
463
+ #endif
464
+ }
465
+
466
+ typedef struct my_dl_wrapper {
467
+ void * handle;
468
+ my_dl_wrapper (void * handle) {
469
+ this ->handle = handle;
470
+ }
471
+ ~my_dl_wrapper () {
472
+ my_dlclose_no_assert (this ->handle );
473
+ }
474
+ } my_dl_wrapper;
475
+ std::vector<std::unique_ptr<my_dl_wrapper>> mmd_libs;
476
+
458
477
cl_bool l_load_board_functions (acl_mmd_dispatch_t *mmd_dispatch,
459
478
const char *library_name, void *mmd_library,
460
479
char *error_msg) {
@@ -630,7 +649,7 @@ cl_bool l_load_single_board_library(const char *library_name,
630
649
++num_boards_found;
631
650
}
632
651
633
- my_dlclose ( mmd_library);
652
+ mmd_libs. push_back (std::make_unique<my_dl_wrapper>( mmd_library) );
634
653
return CL_TRUE;
635
654
}
636
655
You can’t perform that action at this time.
0 commit comments