![]() |
|
#35
|
|||
|
|||
|
youre mixing stuff up. that GetModuleHandle/LoadLibrary is from original post and thats C, functor in C w/ destructor?
my c++14 version keeps lib ref count constant, thats the sole purpose of the map (what you call 'cache') also you want to keep lib loaded as dlls might have some init/deinit functions or keep some state between calls. so if you want to fix version from original post use GetModuleHandleEx and call FreeLibrary later only if GetModuleHandleEx returned a valid handle. for my c++ version just use thread_local on map like i ve already said before. this will also fix if a dll uses DLL_THREAD_ATTACH which a mutex does not. |
| The Following User Says Thank You to bugficks For This Useful Post: | ||
Indigo (07-19-2019) | ||
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calling any function dynamically without typedef | Succubus | Source Code | 0 | 10-21-2021 16:34 |
| WinAPI: No WM_COMMAND Message? | aldente | General Discussion | 2 | 07-05-2006 07:17 |