From jeffrey.ryan at lemnica.com  Fri Mar 11 19:19:33 2011
From: jeffrey.ryan at lemnica.com (Jeffrey Ryan)
Date: Fri, 11 Mar 2011 12:19:33 -0600
Subject: [Rd] hook for when R quits
In-Reply-To: <AANLkTi=6WYeM-xfqWAxbFNDT83BadEL=mifG26t5ZacN@mail.gmail.com>
References: <AANLkTi=6WYeM-xfqWAxbFNDT83BadEL=mifG26t5ZacN@mail.gmail.com>
Message-ID: <AANLkTinJPXGWswSpQ-9d8UEzYJW_zU4hAjViNNXWtbUh@mail.gmail.com>

Take a look at reg.finalizer.  You'd have to create an object
internally that would persist until R exits - and a related function
to handle cleanup of course.

HTH
Jeff

On Fri, Mar 11, 2011 at 12:08 PM, Michael Lawrence
<lawrence.michael at gene.com> wrote:
> Hi,
>
> Is there any way that a package can listen for when R quits? The Qt stuff is
> hooking into platform-specific event loops and when those die unexpectedly
> (from the perspective of Qt), it aborts, causing an annoying error dialog.
> If we could catch when R is killed, we could cleanup, like we do with
> .onUnload.
>
> Thanks,
> Michael
>
> ? ? ? ?[[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



-- 
Jeffrey Ryan
jeffrey.ryan at lemnica.com

www.lemnica.com



[Rd] hook for when R quits
Jeffrey Ryan