summaryrefslogtreecommitdiffstats
path: root/generic/ttk
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2010-10-11 21:34:45 (GMT)
committerjenglish <jenglish@flightlab.com>2010-10-11 21:34:45 (GMT)
commitaff4deb1051f578be23a9c8449439e912d976c08 (patch)
treeab51d96c180845d6c165b2daec6782369de0feca /generic/ttk
parent0a4da5d57f06d8c18a71b3cbffaddda4da894b41 (diff)
downloadtk-aff4deb1051f578be23a9c8449439e912d976c08.zip
tk-aff4deb1051f578be23a9c8449439e912d976c08.tar.gz
tk-aff4deb1051f578be23a9c8449439e912d976c08.tar.bz2
Fix crash in 'tag add' / 'tag remove' when no -tags specified [SF#3085489].
Diffstat (limited to 'generic/ttk')
-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 899ab17..d7afb3c 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -1,4 +1,4 @@
-/* $Id: ttkTreeview.c,v 1.40 2010/09/08 17:57:07 jenglish Exp $
+/* $Id: ttkTreeview.c,v 1.41 2010/10/11 21:34:45 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);
}