summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2010-10-11 21:35:27 (GMT)
committerjenglish <jenglish@flightlab.com>2010-10-11 21:35:27 (GMT)
commit77bf3ab590b4d2db7dfef2295444b5ef0f0d6723 (patch)
tree1ed7927ca375d0f312bc0e5a8667669b4aba4199 /generic
parent83e899ada1765ac80098a4c4cd80d0a8e0b04da0 (diff)
downloadtk-77bf3ab590b4d2db7dfef2295444b5ef0f0d6723.zip
tk-77bf3ab590b4d2db7dfef2295444b5ef0f0d6723.tar.gz
tk-77bf3ab590b4d2db7dfef2295444b5ef0f0d6723.tar.bz2
Fix crash in 'tag add' / 'tag remove' when no -tags specified [SF#3085489].
Diffstat (limited to 'generic')
-rw-r--r--generic/ttk/ttkTreeview.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index 58ff7f0..fca8aa7 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -1,4 +1,4 @@
-/* $Id: ttkTreeview.c,v 1.23.2.3 2010/09/08 17:57:52 jenglish Exp $
+/* $Id: ttkTreeview.c,v 1.23.2.4 2010/10/11 21:35:27 jenglish Exp $
* Copyright (c) 2004, Joe English
*
* ttk::treeview widget implementation.
@@ -3140,7 +3140,7 @@ static int TreeviewTagNamesCommand(
static void AddTag(TreeItem *item, Ttk_Tag tag)
{
if (Ttk_TagSetAdd(item->tagset, tag)) {
- Tcl_DecrRefCount(item->tagsObj);
+ if (item->tagsObj) Tcl_DecrRefCount(item->tagsObj);
item->tagsObj = Ttk_NewTagSetObj(item->tagset);
Tcl_IncrRefCount(item->tagsObj);
}
@@ -3173,12 +3173,12 @@ static int TreeviewTagAddCommand(
return TCL_OK;
}
-/* + $tv tag remove $tag $items
+/* + $tv tag remove $tag ?$items?
*/
static void RemoveTag(TreeItem *item, Ttk_Tag tag)
{
if (Ttk_TagSetRemove(item->tagset, tag)) {
- Tcl_DecrRefCount(item->tagsObj);
+ if (item->tagsObj) Tcl_DecrRefCount(item->tagsObj);
item->tagsObj = Ttk_NewTagSetObj(item->tagset);
Tcl_IncrRefCount(item->tagsObj);
}