Tk Source Code

Check-in [b3533d47]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix for the failing/crashing listbox tests.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | bug-5d991b822e
Files: files | file ages | folders
SHA3-256: b3533d47047a4deaa7477b529e1a6ed5f66caaaa461378393f0b9f3fb3ec7731
User & Date: dgp 2019-05-15 17:08:01.738
Context
2019-05-15
17:16
Tests and fix for [menubutton ... -textvariable]. check-in: fdcced06 user: dgp tags: bug-5d991b822e
17:08
Fix for the failing/crashing listbox tests. check-in: b3533d47 user: dgp tags: bug-5d991b822e
17:01
Tests for same issues with [listbox ... -listvariable]. check-in: 2271428c user: dgp tags: bug-5d991b822e
Changes
Unified Diff Ignore Whitespace Patch
Changes to generic/tkListbox.c.
3441
3442
3443
3444
3445
3446
3447
3448





















3449
3450
3451
3452
3453
3454
3455
    Tcl_HashEntry *entry;

    /*
     * Bwah hahahaha! Puny mortal, you can't unset a -listvar'd variable!
     */

    if (flags & TCL_TRACE_UNSETS) {
	if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) {





















	    Tcl_SetVar2Ex(interp, listPtr->listVarName, NULL,
		    listPtr->listObj, TCL_GLOBAL_ONLY);
	    Tcl_TraceVar2(interp, listPtr->listVarName,
		    NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
		    ListboxListVarProc, clientData);
	    return NULL;
	}







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
    Tcl_HashEntry *entry;

    /*
     * Bwah hahahaha! Puny mortal, you can't unset a -listvar'd variable!
     */

    if (flags & TCL_TRACE_UNSETS) {

        if (!Tcl_InterpDeleted(interp) && listPtr->listVarName) {
            ClientData probe = NULL;

            do {
                probe = Tcl_VarTraceInfo(interp,
                        listPtr->listVarName,
                        TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
                        ListboxListVarProc, probe);
                if (probe == (ClientData)listPtr) {
                    break;
                }
            } while (probe);
            if (probe) {
                /*
                 * We were able to fetch the unset trace for our
                 * listVarName, which means it is not unset and not
                 * the cause of this unset trace. Instead some outdated
                 * former variable must be, and we should ignore it.
                 */
                return NULL;
            }
	    Tcl_SetVar2Ex(interp, listPtr->listVarName, NULL,
		    listPtr->listObj, TCL_GLOBAL_ONLY);
	    Tcl_TraceVar2(interp, listPtr->listVarName,
		    NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
		    ListboxListVarProc, clientData);
	    return NULL;
	}