I have the following problem, which I'm hoping someone here can help me with.
I have a C++ mex file which is linked against a dynamic library. Everything compiles and links fine and the function is doing what it's supposed to be doing. However, when I call that mex function for the first time, Matlab locks the .dll file and does not release it until I quit Matlab (e.g. I can't delete or overwrite the file while Matlab is running). This is annoying because I want to be able to recompile and test the dynamic library without having to quit Matlab every time. How do I tell Matlab to release/clear/unload that dll?