Cleaning up after the Close button is pressed

Hi everyone, I have to perform cleanup when my application terminates. GHC.ConsoleHandler handles cleanup from Ctrl-C and Ctrl-Break very nicely under Windows. Unfortunately, the RTS does not support delivery of the Close button event. The reason given in rts/win32/ConsoleHandler.c is that an improperly-written Haskell handler will prevent the user from being able to kill the application. I have a few questions about this. 1) Is there a different way of cleaning up on Windows after the Close button is pressed? 2) It seems strange that GHC intentionally prevents the application from cleaning up in order to guarantee that it will terminate as the user expects. Why is it not the application developer's responsibility to ensure that it can be killed? Thanks, Colin

Hi Colin If no-one has answered your query off-list you might want to punt it to the GHC users list or Haskell-cafe. Questions about a specific technology generally seem to get answered quicker on Haskell-cafe than Beginners, if they are specifically about GHC they seem to get the best answers on the GHC list. The Beginners list seems the best place for "general" elementary Haskell questions (answers are usually more explanatory than they would be on Haskell-cafe), but not questions about specific libraries or GHC specifics as such questions can be missed by people with the specific knowledge. Best wishes Stephen
participants (2)
-
Colin Hume
-
Stephen Tetley