- Joined
- Dec 13, 2018
- Messages
- 384
I'm saving out some .png files and need to delete temporary files on closing the app. I have an OnClose method as follows (also called when quitting via escape key) but it doesn't delete the temporary files even though they exist and are greater than zero bytes. Does DeleteFile() maybe require a full path and if so what's the most reliable way of setting it?
Also, should OnClose() be changed so as not to require a return value? Since it needs to call EndApp() any return statement is unreachable. I suppose you could call OnClose() and when it returns (I assume it returns, I haven't tried it!) call EndApp() but that seems kind of weird and defeats the object of having an OnClose event.
This is GLFW/debug build on Linux:
Also, should OnClose() be changed so as not to require a return value? Since it needs to call EndApp() any return statement is unreachable. I suppose you could call OnClose() and when it returns (I assume it returns, I haven't tried it!) call EndApp() but that seems kind of weird and defeats the object of having an OnClose event.
This is GLFW/debug build on Linux:
Cerberus:
Method OnClose:Int()
' cleanup temporary files
If FileSize("tile1.png") = 0 Then DeleteFile("tile1.png")
If FileSize("tile2.png") = 0 Then DeleteFile("tile2.png")
If FileSize("tile3.png") = 0 Then DeleteFile("tile3.png")
EndApp()
' unreachable!
Return 0
End