I have created a C++ MEX-function. In the MEX-function, I create instances of a class. This class has a destructor which performs some cleanup. I expect the destructor to be called whenever the class instance goes out of scope. However, when an error occurs in the MEX-function, the destructor does not seem to be called.
MATLAB: Does the class destructor not execute after an error occurs in a C++ MEX-file in MATLAB
MATLAB
Best Answer