From 71a392fe81a8078171b30217c82911974f1302cd Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Sun, 13 Aug 2006 12:29:26 +0000 Subject: [PATCH] The non-const functions here should call detach. git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@572630 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- toolkit/tmap.tcc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/toolkit/tmap.tcc b/toolkit/tmap.tcc index b9787a0f..afb7db4c 100644 --- a/toolkit/tmap.tcc +++ b/toolkit/tmap.tcc @@ -106,6 +106,7 @@ bool Map::isEmpty() const template typename Map::Iterator Map::find(const Key &key) { + detach(); return d->map.find(key); } @@ -124,6 +125,7 @@ bool Map::contains(const Key &key) const template Map &Map::erase(Iterator it) { + detach(); d->map.erase(it); return *this; } @@ -143,7 +145,8 @@ const T &Map::operator[](const Key &key) const template T &Map::operator[](const Key &key) { - return d->map[key]; + detach(); + return d->map[key]; } template