【发布时间】:2014-07-09 03:22:05
【问题描述】:
即使在 ~/.cabal/config 中启用了库配置文件的情况下安装了光泽度,配置文件选项也无法使用,
示例:Test.hs
import Graphics.Gloss
main = display (InWindow "test" (800, 600) (200, 200)) black blank
编译运行:
$ ghc Test.hs
[1 of 1] Compiling Test ( Test.hs, Test.o )
Linking Test ...
$ ./Test +RTS -s
然后我用窗口的 x 按钮关闭窗口,但没有任何 gc 输出。
如果我将 Test.hs 更改为 main = print "test" 并重复这些步骤,它会输出一些与垃圾收集相关的信息,这是应该发生的。
【问题讨论】:
-
当 glut 主窗口关闭时,它会退出整个程序。可以设置
actionOnWindowClose变量,但是需要修改gloss的源代码。