# testing for a memory leak

proc incr_label {} {
    global timer

    .lab getValues -labelString n
    incr n
    .lab setValues -labelString $n
    set timer [. addTimer 1000 incr_label]
}

xtAppInitialize

xmPushButton .lab managed -labelString 1
.lab activateCallback {. removeTimer $timer; .lab destroyWidget}

set timer [. addTimer 1000 incr_label]

. realizeWidget

. mainLoop
