Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(871)

Unified Diff: ui/base/ime/chromeos/ime_keyboard_x11.cc

Issue 989993002: x11: Use scoped_ptr<> for X11 objects where it makes sense. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/idle/idle_query_x11.cc ('k') | ui/base/x/selection_owner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/chromeos/ime_keyboard_x11.cc
diff --git a/ui/base/ime/chromeos/ime_keyboard_x11.cc b/ui/base/ime/chromeos/ime_keyboard_x11.cc
index 8b76ed0867bfb3f5de9b0dff91b99c9a394de5ac..55be02cb0ade011441eb456ee014ef5cc1c61263 100644
--- a/ui/base/ime/chromeos/ime_keyboard_x11.cc
+++ b/ui/base/ime/chromeos/ime_keyboard_x11.cc
@@ -84,12 +84,11 @@ unsigned int ImeKeyboardX11::GetNumLockMask() {
const std::string string_to_find(kNumLockVirtualModifierString);
for (size_t i = 0; i < XkbNumVirtualMods; ++i) {
const unsigned int virtual_mod_mask = 1U << i;
- char* virtual_mod_str_raw_ptr =
- XGetAtomName(xkb_desc->dpy, xkb_desc->names->vmods[i]);
+ gfx::XScopedPtr<char> virtual_mod_str_raw_ptr(
+ XGetAtomName(xkb_desc->dpy, xkb_desc->names->vmods[i]));
if (!virtual_mod_str_raw_ptr)
continue;
- const std::string virtual_mod_str = virtual_mod_str_raw_ptr;
- XFree(virtual_mod_str_raw_ptr);
+ const std::string virtual_mod_str = virtual_mod_str_raw_ptr.get();
if (string_to_find == virtual_mod_str) {
if (!XkbVirtualModsToReal(xkb_desc, virtual_mod_mask, &real_mask)) {
« no previous file with comments | « ui/base/idle/idle_query_x11.cc ('k') | ui/base/x/selection_owner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698