summaryrefslogtreecommitdiffstats
path: root/ui/base/touch
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-07 21:50:46 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-07 21:50:46 +0000
commitf5e13afafdd1ac1748463f7cdda785ef7937fa59 (patch)
treedb55d78edf9ea8fd6703a295f1f3042281cf4390 /ui/base/touch
parent1b5c8efba3a48fe10a5096c3d199926c7c5c15b8 (diff)
downloadchromium_src-f5e13afafdd1ac1748463f7cdda785ef7937fa59.zip
chromium_src-f5e13afafdd1ac1748463f7cdda785ef7937fa59.tar.gz
chromium_src-f5e13afafdd1ac1748463f7cdda785ef7937fa59.tar.bz2
Fix some memory leaks.
BUG=112803, 112795 TEST=none Review URL: https://chromiumcodereview.appspot.com/9333005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120827 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/touch')
-rw-r--r--ui/base/touch/touch_factory.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/ui/base/touch/touch_factory.cc b/ui/base/touch/touch_factory.cc
index b636ea0..f2faf1d 100644
--- a/ui/base/touch/touch_factory.cc
+++ b/ui/base/touch/touch_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -64,8 +64,8 @@ XIValuatorClassInfo* FindTPValuator(Display* display,
reinterpret_cast<XIValuatorClassInfo*>(info->classes[i]);
if (v->label) {
- const char* atom = XGetAtomName(display, v->label);
- if (atom && strcmp(atom, atom_tp) == 0)
+ ui::XScopedString atom(XGetAtomName(display, v->label));
+ if (atom.string() && strcmp(atom.string(), atom_tp) == 0)
return v;
}
}
@@ -151,8 +151,8 @@ void TouchFactory::UpdateDeviceList(Display* display) {
XDeviceInfo* devlist = XListInputDevices(display, &count);
for (int i = 0; i < count; i++) {
if (devlist[i].type) {
- const char* devtype = XGetAtomName(display, devlist[i].type);
- if (devtype && !strcmp(devtype, XI_TOUCHSCREEN)) {
+ XScopedString devtype(XGetAtomName(display, devlist[i].type));
+ if (devtype.string() && !strcmp(devtype.string(), XI_TOUCHSCREEN)) {
touch_device_lookup_[devlist[i].id] = true;
touch_device_list_[devlist[i].id] = true;
touch_device_available_ = true;