Free engine resources during runtime
Release all MATLAB® engine resources during runtime when you no longer need the MATLAB engine in your application program.
Programs cannot start a new MATLAB engine or connect to a shared MATLAB session after calling
Terminate the engine session to free resources.
// Start MATLAB session std::unique_ptr<MATLABEngine> matlabPtr = startMATLAB(); ... // Terminate MATLAB session matlab::engine::terminateEngineClient();