Commit a36f5b52 authored by anand.ratn's avatar anand.ratn Committed by Commit bot

Declaring the weak_ptr_factory in proper order.

Cleaning up weak_ptr_factory destruction order in "src/remoting" module.
WeakPtrFactory should remain the last member so it'll be destroyed
and invalidate its weak pointers before any other members are
destroyed.

BUG=303818

Review URL: https://codereview.chromium.org/551393003

Cr-Commit-Position: refs/heads/master@{#294331}
parent 056bd071
......@@ -93,8 +93,8 @@ IpcDesktopEnvironmentFactory::IpcDesktopEnvironmentFactory(
io_task_runner_(io_task_runner),
curtain_enabled_(false),
daemon_channel_(daemon_channel),
connector_factory_(this),
next_id_(0) {
next_id_(0),
connector_factory_(this) {
}
IpcDesktopEnvironmentFactory::~IpcDesktopEnvironmentFactory() {
......
......@@ -128,14 +128,14 @@ class IpcDesktopEnvironmentFactory
typedef std::map<int, DesktopSessionProxy*> ActiveConnectionsList;
ActiveConnectionsList active_connections_;
// Factory for weak pointers to DesktopSessionConnector interface.
base::WeakPtrFactory<DesktopSessionConnector> connector_factory_;
// Next desktop session ID. IDs are allocated sequentially starting from 0.
// This gives us more than 67 years of unique IDs assuming a new ID is
// allocated every second.
int next_id_;
// Factory for weak pointers to DesktopSessionConnector interface.
base::WeakPtrFactory<DesktopSessionConnector> connector_factory_;
DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironmentFactory);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment