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

Unified Diff: ui/events/devices/device_data_manager.cc

Issue 1074963003: Clean up potentially leaky use of base::DeletePointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed another probleb Created 5 years, 8 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 | « media/cast/sender/video_encoder_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/devices/device_data_manager.cc
diff --git a/ui/events/devices/device_data_manager.cc b/ui/events/devices/device_data_manager.cc
index 628813a8905dfdddec07dd946af5c796cf85cfaf..ff59f5bbd2a3b03e08ad2179de15c4ee846937b4 100644
--- a/ui/events/devices/device_data_manager.cc
+++ b/ui/events/devices/device_data_manager.cc
@@ -28,8 +28,10 @@ DeviceDataManager::DeviceDataManager() {
CHECK(!instance_) << "Can not create multiple instances of DeviceDataManager";
instance_ = this;
+ scoped_ptr<DeviceDataManager> owned_instance(instance_);
base::AtExitManager::RegisterTask(
- base::Bind(&base::DeletePointer<DeviceDataManager>, this));
+ base::Bind(&base::DeletePointer<DeviceDataManager>,
+ base::Passed(&owned_instance)));
ClearTouchDeviceAssociations();
}
« no previous file with comments | « media/cast/sender/video_encoder_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698