Преглед на файлове

HDFS-9687. libhdfs++: potential segfault after teardown. Contributed by Bob Hansen.

James преди 9 години
родител
ревизия
d8736e6bf4
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_connection.h

+ 3 - 2
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_connection.h

@@ -205,8 +205,9 @@ void RpcConnectionImpl<NextLayer>::FlushPendingRequests() {
 
     req->timer().expires_from_now(
         std::chrono::milliseconds(options_.rpc_timeout));
-    req->timer().async_wait(std::bind(
-      &RpcConnection::HandleRpcTimeout, this, req, _1));
+    req->timer().async_wait([shared_this, this, req](const ::asio::error_code &ec) {
+        this->HandleRpcTimeout(req, ec);
+    });
 
     asio::async_write(next_layer_, asio::buffer(*payload),
                       [shared_this, this, payload](const ::asio::error_code &ec,