Tk Source Code

View Ticket
Login
Ticket UUID: 220112
Title: zombie processes left behind on Windows NT
Type: Bug Version: obsolete: 8.2
Submitter: welch Created on: 2000-10-31 22:36:10
Subsystem: 68. Win Window Operations Assigned To: nobody
Priority: 2 Severity:
Status: Closed Last Modified: 2001-03-23 02:22:06
Resolution: Fixed Closed By: dgp
    Closed on: 2001-03-22 19:22:06
Description:
OriginalBugID: 755 Bug
Version: 8.0.3
SubmitDate: '1998-10-22'
LastModified: '2000-01-06'
Severity: MED
Status: Closed
Submitter: admin
ChangedBy: hobbs
OS: Windows NT
FixedInVersion: NA
ClosedDate: '2000-01-06'


The enclosed file leaves a zombie process on Win NT.  To recreate,
make sure prowish80.exe is the default *.tcl exe, and then double
click on the zombie.tcl file.

bill wilborn wrote:

I got a fix for this problem at the conference.   Iam now including
    "wm protocol . WM_DELETE_WINDOW {exit}"
in each program so when the X is selected to close the window, the Tk
exit routine is run.

  -Bill Wilborn

brent wrote:

The solution to the "zombie" problem is a nice work-around, but still,
it's a hack.  I'd like too understand what's causing the problem, so
we can fix it in the Tcl core.

  -brent
------
# zombie.tcl

global widget; 

proc {main} {argc argv} {

}

proc {Window} {args} {
global vTcl
    set cmd [lindex $args 0]
    set name [lindex $args 1]
    set newname [lindex $args 2]
    set rest [lrange $args 3 end]
    if {$name == "" || $cmd == ""} {return}
    if {$newname == ""} {
        set newname $name
    }
    set exists [winfo exists $newname]
    switch $cmd {
        show {
            if {$exists == "1" && $name != "."} {wm deiconify $name; return}
            if {[info procs vTclWindow(pre)$name] != ""} {
                eval "vTclWindow(pre)$name $newname $rest"
            }
            if {[info procs vTclWindow$name] != ""} {
                eval "vTclWindow$name $newname $rest"
            }
            if {[info procs vTclWindow(post)$name] != ""} {
                eval "vTclWindow(post)$name $newname $rest"
            }
        }
        hide    { if $exists {wm withdraw $newname; return} }
        iconify { if $exists {wm iconify $newname; return} }
        destroy { if $exists {destroy $newname; return} }
    }
}

#################################
# VTCL GENERATED GUI PROCEDURES
#

proc vTclWindow. {base} {
    if {$base == ""} {
        set base .
    }
    ###################
    # CREATING WIDGETS
    ###################
    wm focusmodel $base passive
    wm geometry $base 200x200+0+0
    wm maxsize $base 1156 849
    wm minsize $base 112 1
    wm overrideredirect $base 0
    wm resizable $base 1 1
    wm withdraw $base
    wm title $base "vt"
    ###################
    # SETTING GEOMETRY
    ###################
}

proc vTclWindow.top17 {base} {
    if {$base == ""} {
        set base .top17
    }
    if {[winfo exists $base]} {
        wm deiconify $base; return
    }
    ###################
    # CREATING WIDGETS
    ###################
    toplevel $base -class Toplevel
    wm focusmodel $base passive
    wm geometry $base 200x111+380+137
    wm maxsize $base 1156 849
    wm minsize $base 112 1
    wm overrideredirect $base 0
    wm resizable $base 1 1
    wm deiconify $base
    wm title $base "Hello World"
    entry $base.ent18  -textvariable txtout 
    button $base.but19  -text {Press Me} -command {set txtout {Hello World}}
    ###################
    # SETTING GEOMETRY
    ###################
    place $base.ent18  -x 5 -y 20 -width 191 -height 22 -anchor nw -bordermode ignore 
    place $base.but19  -x 65 -y 60 -anchor nw -bordermode ignore 
}

Window show .
Window show .top17

main $argc $argv



Verified with 8.3b1 on NTsp4. 
-- 01/06/2000 hobbs
After further examination (This VTcl stuff is just screwy...), this
is not a zombie process.  What is happening is that the user has
caused the true '.' main window to be "withdrawn", which means it
won't show up in the taskbar.  The window that you X out is .top17,
and thus you leave the wish process running with . hidden. 
-- 01/06/2000 hobbs