From 80d43beb6caae9ce728cd5054194124706038073 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 11 Mar 2013 18:02:47 +0000 Subject: 3607326 Stop segfault from [listbox .l -listvariable $array]. --- ChangeLog | 5 +++++ generic/tkListbox.c | 3 --- tests/listbox.test | 11 +++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d471002..19a5bac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-03-11 Don Porter + + * generic/tkListbox.c: [Bug 3607326] Stop segfault from + * tests/listbox.test: [listbox .l -listvariable $array]. + 2013-02-28 Donal K. Fellows * unix/tkUnixKey.c (TkpGetKeySym): [Bug 3599312]: Put the diff --git a/generic/tkListbox.c b/generic/tkListbox.c index d803d7b..248dd7b 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -1630,9 +1630,6 @@ ConfigureListbox( if (Tcl_SetVar2Ex(interp, listPtr->listVarName, NULL, listVarObj, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { - if (oldListObj == NULL) { - Tcl_DecrRefCount(listVarObj); - } continue; } } diff --git a/tests/listbox.test b/tests/listbox.test index 25bc606..b4046b6 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -2158,6 +2158,17 @@ test listbox-29.1 {listbox selection behavior, -state disabled} { lappend out [.l selection includes 2] [.l curselection] } {1 1 2} +test listbox-30.1 {Bug 3607326} -setup { + destroy .l + unset -nocomplain a +} -body { + array set a {} + listbox .l -listvariable a +} -cleanup { + destroy .l + unset -nocomplain a +} -result * -match glob -returnCodes error + resetGridInfo deleteWindows option clear -- cgit v0.12