Re: catch logout/SIGHUP
- From: Chris Vine <chris cvine freeserve co uk>
- To: gtk-list gnome org
- Cc:
- Subject: Re: catch logout/SIGHUP
- Date: Sun, 24 Jul 2005 00:42:12 +0100
On Thursday 21 July 2005 02:39, Jochen Baier wrote:
> hi,
>
> i wonder what is the right procedure to do some cleanup if the user
> logout from session
> and the program is still alive. ("Save file before exit" etc)
>
> I thought "system (SIGHUP,...)" is the right way, but i didnt find this
> function in code from gedit, anjuta etc.. so what is the right way to
> do this ?
You should use g_atexit() (or the equivalent standard C function on_exit())
for cleanup, but at the stage that it executes it is too late to do anything
interactive with the user. (But if the user has caused his X session to
close down it is too late to do that anyway.)
Chris
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]