Closed delyan-kirov closed 7 months ago
While working on my little applet, I found that using the foreign C functions will not crash the app and will give the correct pointer and the correct file path.
fileIsDropped <- isFileDropped
when fileIsDropped $ do
filePtr <- c'loadDroppedFiles
print filePtr
fileData <- peek filePtr
print fileData
c'unloadDroppedFiles filePtr
Fixed in 5.1.2.0
Trying to drag and drop files fails. Particularly using the function
loadDroppedFiles
will seg fault while trying to free an invalid pointer to the file path:Or it will try to double free:
It does that on the next frame or the frame after. I'm not sure if this is user error, because I don't know what I should or should not free manually and how. This is a basic version of what I tried: