# Is there a way to perform an on-quit action?

**URL:** <https://www.ruby-forum.com/t/is-there-a-way-to-perform-an-on-quit-action/242074>\
**Category:** Ruby-Gnome 2\
**Created:** [May 25, 2015, 6:56am UTC](https://www.ruby-forum.com/t/is-there-a-way-to-perform-an-on-quit-action/242074 "2015-05-25T06:56:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [May 25, 2015, 6:56am UTC](https://www.ruby-forum.com/t/is-there-a-way-to-perform-an-on-quit-action/242074/1 "2015-05-25T06:56:16Z")

</div>

Hi,

One rubygnome program creates a gmon.out file in the current working  
directory. I do not know why but I don’t want this file.

Is there either:

(a) a way to prevent the creation of a gmon.out file

or

(b) an on-quit event handler or similar, so that I could  
use File.delete(‘gmon.out’) to get rid of said file?

I don’t want to use at\_exit() because that feels unclean  
when I use that GUI program from other GUI programs (like  
in a tab, and they’d all use different at-exit handlers)
