diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-12-20 16:54:07 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-12-20 16:54:07 +0100 |
commit | 4c5b1b6713628d91554d934ee72661b83232bbf7 (patch) | |
tree | 21ce6867bb467f47d32af3a64b2c0955082df58a /drumgizmo/audioinputenginedl.cc | |
parent | 89cfec5ae70d3770bc1fb55c658c2551c9a9dd42 (diff) |
Free dlopen resources.
Diffstat (limited to 'drumgizmo/audioinputenginedl.cc')
-rw-r--r-- | drumgizmo/audioinputenginedl.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drumgizmo/audioinputenginedl.cc b/drumgizmo/audioinputenginedl.cc index 93c7079..cba59fa 100644 --- a/drumgizmo/audioinputenginedl.cc +++ b/drumgizmo/audioinputenginedl.cc @@ -41,7 +41,7 @@ AudioInputEngineDL::AudioInputEngineDL(std::string name) is_jack_plugin = strstr(name.c_str(), "jack"); std::string plugin = INPUT_PLUGIN_DIR"/" + name + ".so"; - void *lib = dlopen(plugin.c_str(), RTLD_LAZY); + lib = dlopen(plugin.c_str(), RTLD_LAZY); if(!lib) { printf("Cannot load device: %s\n", dlerror()); return; @@ -124,6 +124,8 @@ AudioInputEngineDL::~AudioInputEngineDL() { i_destroy(ptr); if(is_jack_plugin) close_jack_client(); + dlclose(lib); + lib = nullptr; } bool AudioInputEngineDL::init(Instruments &instruments) |