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

Unified Diff: ui/base/x/selection_owner.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/ime/chromeos/ime_keyboard_x11.cc ('k') | ui/base/x/x11_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/selection_owner.cc
diff --git a/ui/base/x/selection_owner.cc b/ui/base/x/selection_owner.cc
index 4dbfb09cc998bddd52faf18324db77d5f356797e..d13f088d5aaf263c367fcb1f465bd6011b32b93a 100644
--- a/ui/base/x/selection_owner.cc
+++ b/ui/base/x/selection_owner.cc
@@ -77,21 +77,19 @@ bool GetAtomPairArrayProperty(XID window,
&num_items,
&remaining_bytes,
&properties);
+ gfx::XScopedPtr<unsigned char> scoped_properties(properties);
if (result != Success)
return false;
// GTK does not require |type| to be kAtomPair.
- if (format != 32 || num_items % 2 != 0) {
- XFree(properties);
+ if (format != 32 || num_items % 2 != 0)
return false;
- }
XAtom* atom_properties = reinterpret_cast<XAtom*>(properties);
value->clear();
for (size_t i = 0; i < num_items; i+=2)
value->push_back(std::make_pair(atom_properties[i], atom_properties[i+1]));
- XFree(properties);
return true;
}
« no previous file with comments | « ui/base/ime/chromeos/ime_keyboard_x11.cc ('k') | ui/base/x/x11_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698