Index: remoting/jingle_glue/jingle_client.cc |
=================================================================== |
--- remoting/jingle_glue/jingle_client.cc (revision 55524) |
+++ remoting/jingle_glue/jingle_client.cc (working copy) |
@@ -76,11 +76,6 @@ |
} |
void JingleClient::Close() { |
- // Once we are closed we really shouldn't talk to the callback again. In the |
- // case when JingleClient outlives the owner access the callback is not safe. |
- // TODO(hclam): We need to lock to reset callback. |
- callback_ = NULL; |
- |
message_loop()->PostTask( |
FROM_HERE, NewRunnableMethod(this, &JingleClient::DoClose)); |
} |
@@ -90,14 +85,12 @@ |
// If we have not yet initialized and the client is already closed then |
// don't close again. |
- if (state_ == CLOSED) |
+ if (!callback_ || state_ == CLOSED) |
return; |
- if (client_) { |
- client_->Disconnect(); |
- // Client is deleted by TaskRunner. |
- client_ = NULL; |
- } |
+ client_->Disconnect(); |
+ // Client is deleted by TaskRunner. |
+ client_ = NULL; |
tunnel_session_client_.reset(); |
port_allocator_.reset(); |
session_manager_.reset(); |