Question about FLTK and FreeBASIC

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Question about FLTK and FreeBASIC

Post by jj2007 »

Raymond Chen on ExitProcess:
Don't worry about freeing memory; it will all go away when the process address space is destroyed. Don't worry about closing handles; handles are closed automatically when the process handle table is destroyed. Don't try to call into other DLLs, because those other DLLs may already have received their DLL_PROCESS_DETACH notifications, in which case they may behave erratically in the same way that a Delphi object behaves erratically if you try to use it after its destructor has run.

The building is being demolished. Don't bother sweeping the floor and emptying the trash cans and erasing the whiteboards. And don't line up at the exit to the building so everybody can move their in/out magnet to out. All you're doing is making the demolition team wait for you to finish these pointless housecleaning tasks.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Question about FLTK and FreeBASIC

Post by MrSwiss »

jep, just as this one (a reply, on the very same page):
harningt
January 6, 2012 at 9:55 am

Just a note – we've been bitten by a bug in Outlook since it calls TerminateProcess to kill itself to avoid cleanup slowdown… problem is… PCSC (via winscard.dll) requires 'clean' shutdown, else device transactions are held open. We ran into problems w/ leaked transactions and put something in DllMain and noticed afterwards that it just isn't called… further debugging w/ Depends let us see that no Dll cleanup was performed at all on shutdown – yielding the TerminateProcess conclusion for Outlook 2010. From a KB article about a 2007 'slow shutdown fix', I am guessing in Outlook 2007 they switched to TerminateProcess to close out so that Outlook plugins/etc couldn't slow things down (too bad Outlook or the KB doesn't document the low-level reality).

Technically PCSC should know the process is dead, but we had to take other complicated measures to perform the clean up.

If only there was another call made on shutdown to notify DLLs that they are going to be dead soon, so perform some nice cleanup before closing out kills all threads/etc…
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Question about FLTK and FreeBASIC

Post by jj2007 »

TerminateProcess <> ExitProcess
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Question about FLTK and FreeBASIC

Post by MrSwiss »

Just carry on, believing in M$ (whether said, written or otherwise), good luck.

They themselfs have screwed up, far to many times in the past, and therefore,
lost plenty credibility ...
Post Reply