summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tk/canvas.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/lib/tk/canvas.rb')
-rw-r--r--ext/tk/lib/tk/canvas.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/tk/lib/tk/canvas.rb b/ext/tk/lib/tk/canvas.rb
index 8823e0bfe8..24dfe04b08 100644
--- a/ext/tk/lib/tk/canvas.rb
+++ b/ext/tk/lib/tk/canvas.rb
@@ -160,8 +160,10 @@ class TkCanvas<TkWindow
def delete(*args)
if TkcItem::CItemID_TBL[self.path]
args.each{|tag|
- find('withtag', tag).each{|item|
- TkcItem::CItemID_TBL[self.path].delete(item.id)
+ find('withtag', tag).each{|item|
+ if item.kind_of?(TkcItem)
+ TkcItem::CItemID_TBL[self.path].delete(item.id)
+ end
}
}
end