Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 723c904bc308d7b797aff5f985104e95a225201c
Ticket: 858493ffffffffffffffffffffffffffffffffff
Win32: DllMain needs SEH around Tcl_Finalize()
User & Date: davygrvy on 2003-12-12 17:21:13
Changes

  1. icomment:
    Logged In: YES 
    user_id=7549
    
    Looks like Tk needs some attention, too.  Its exit handler, 
    DeleteWindowsExitProc, is called *AFTER* Tk has been 
    unloaded by the OS under exception condition, or at least 
    from the ExitProcess condition.  No wonder is goes bang.  
    This isn't surprising as DLLs are unloaded in reverse order they 
    were loaded.  If Tcl is calling exit handlers in other 
    extensions, no wonder they crash, they've all been unloaded 
    already..  They're all big dangling pointers..
    
    Now things are getting interesting :)
    
    Should Tk have it's own Tk_CreateExitHandler so it can clean 
    itself up from its DllMain given the OS is taking it down before 
    Tcl?  I think so.  I'll scan the Tk source for more 
    Tcl_CreateExitHandler calls to make sure this is the only one, 
    and if so, just calling DeleteWindowsExitProc from 
    DLL_PROCESS_DETACH should succeed along with a 
    Tcl_DeleteExitHandler to remove it.  That's the easy fix.
    
    Will study this some more..  A very interesting problem.
    
    
  2. login: "davygrvy"
  3. mimetype: "text/plain"
  4. username: "davygrvy"