jatinchowdhury18 / ChowDSP-VCV

ChowDSP modules for VCV Rack
GNU General Public License v3.0
83 stars 8 forks source link

Fix delete/free inconsistency and adjust file browser for cardinal #28

Closed falkTX closed 2 years ago

falkTX commented 2 years ago

Your file utils are using std::unique_ptr which uses C++ new/delete operations behind the scenes. The value returned by osdialog_file is a C-style malloc pointer, which needs the C-style free call. Mismatch of new/delete with malloc/free can cause crashes. This PR fixes it, so that we use the correct free call.

Additionally the file browser stuff is also patched to work in Cardinal, where I do not allow osdialog as it blocks the host event loop (IMO that is very bad practice).

falkTX commented 2 years ago

Just so we are clear here: I will wait for you to rework the file utils to do the unique_ptr + free approach, potentially making it async too, then I will rebase this PR on top. Ping me once done, thanks!

jatinchowdhury18 commented 2 years ago

Fixed with #30