summaryrefslogtreecommitdiffstats
path: root/dbus/property.cc
diff options
context:
space:
mode:
authorkeybuk@google.com <keybuk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-21 23:43:45 +0000
committerkeybuk@google.com <keybuk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-21 23:43:45 +0000
commit72bbaccaa082a3ad6fff9bbc1cf70d01dabd79e8 (patch)
tree4e166217bf3c9cf8b2f88e518080b74a7ca324bf /dbus/property.cc
parent21e0c7bdcf2916d98b5e9668ba6f3e9ddf8b0132 (diff)
downloadchromium_src-72bbaccaa082a3ad6fff9bbc1cf70d01dabd79e8.zip
chromium_src-72bbaccaa082a3ad6fff9bbc1cf70d01dabd79e8.tar.gz
chromium_src-72bbaccaa082a3ad6fff9bbc1cf70d01dabd79e8.tar.bz2
dbus: clear array values before reading from variant
PopArrayFromVariant() appends values to the existing value, rather than clearing first like I expected, so using this without clear() first means the property value accumulates all values and never loses them. BUG=none TEST=unit test included Change-Id: Ie392a89190f4ad8570a905f24b2f446e1f2bed81 R=satorux@chromium.org Review URL: https://chromiumcodereview.appspot.com/9809001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128108 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus/property.cc')
-rw-r--r--dbus/property.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/dbus/property.cc b/dbus/property.cc
index 0d6e7f0..0abe001 100644
--- a/dbus/property.cc
+++ b/dbus/property.cc
@@ -382,6 +382,7 @@ bool Property<std::vector<std::string> >::PopValueFromReader(
if (!reader->PopVariant(&variant_reader))
return false;
+ value_.clear();
return variant_reader.PopArrayOfStrings(&value_);
}
@@ -406,6 +407,7 @@ bool Property<std::vector<ObjectPath> >::PopValueFromReader(
if (!reader->PopVariant(&variant_reader))
return false;
+ value_.clear();
return variant_reader.PopArrayOfObjectPaths(&value_);
}