🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #16008

Re: log off/ application terminate

#16008
From: Duane Hebert
Date: Wed, 04 Jun 2003 01:13
28 lines
2458 bytes
"Ed Mulroy [TeamB]" <ed@mulroyREMOVETHESECHARS.org> wrote in message
news:3edd3cdd@newsgroups.borland.com...
> Here is a mean hack that you might try.
>
> Write a function that takes no calling parameters and returns no value
[void
> funcname(void)] and use its name in a call to atexit  Set a static global
to
> some value (1 would work) and have the code that ends the watchdog clear
it
> to zero.  Have your function check that global and end the watchdog if the
> global is non-zero.
>
> This is based on the fact that atexit items seem to be reliably executed.
> However the exception handling system and all destructors are taken apart
> before that point, so make the code stop the watchdog and not do anything
> fancy.
>

Thanks Ed.  The watchdog is handled by a class that is instantiated in the
ctor of the main form and deleted in  it's dtor.  The dtor of the watchdog,
kills the watchdog.  If I understand you correctly, you're suggesting to
write a function to delete the watchdog object and call this function in
atexit().  I will try that in the morning
though I'm not sure about atexit() when there is no logoff.  In that case,
it works fine.  If I delete several objects in the main form's dtor and then
call atexit() can I be sure that the other deletes will succeed?
Technical Details
Message-ID: <3edd47ba@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3edccd80@newsgroups.borland.com> <3edcd422$1@newsgroups.borland.com> <3edcdbb6@newsgroups.borland.com> <3edcea6f$1@newsgroups.borland.com> <3edcf095$3@newsgroups.borland.com> <3edd3cdd@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,f4b8abe1a2fab575
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-06-03 18:17:37 PST
From: "Duane Hebert" <spoo@flarn.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3edccd80@newsgroups.borland.com> <3edcd422$1@newsgroups.borland.com> <3edcdbb6@newsgroups.borland.com> <3edcea6f$1@newsgroups.borland.com> <3edcf095$3@newsgroups.borland.com> <3edd3cdd@newsgroups.borland.com>
Subject: Re: log off/ application terminate
Date: Tue, 3 Jun 2003 21:13:45 -0400
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 66.131.59.71
Message-ID: <3edd47ba@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1054689210 66.131.59.71 (3 Jun 2003 18:13:30 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail