mathworks / libmexclass

libmexclass is a MATLAB framework which enables users to implement the functionality of MATLAB classes in terms of equivalent C++ classes using MEX.
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

"Delete" instead of "Destroy" is passed as the Action string to the MEX gateway call in the Proxy class delete method #29

Closed kevingurney closed 1 year ago

kevingurney commented 1 year ago

In the implementation of the delete method for libmexclass.proxy.Proxy the Action string "Delete" is passed instead of "Destroy" to the MEX gateway function. This is a typo.

See: https://github.com/mathworks/libmexclass/blob/b6b54c233de09c289074c20e73f3ac38dfe20160/libmexclass/matlab/%2Blibmexclass/%2Bproxy/Proxy.m#L17

The result of this typo is that Proxy instances managed by the ProxyManager are not getting destroyed as expected.

This seems to be related to a crash that is occurring on Debian 10 when shutting down MATLAB. In the crash log the instances of shared_ptr<Proxy> stored in in the unordered_map managed by the ProxyManager appear to be locked in some way on MATLAB shutdown, which is preventing proper destruction.