diff options
author | Pavel Labath <pavel@labath.sk> | 2020-04-02 14:40:59 +0200 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2020-04-02 14:42:25 +0200 |
commit | 451741a9d778a260ceee608a26b5fdf2d9926982 (patch) | |
tree | 945c6de2f63d9be79125b8ceeee0fde3eeff5f36 /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | |
parent | 13a1504ffb9a9a4f82dc1b60d9e8cbb173c7d030 (diff) | |
download | llvm-451741a9d778a260ceee608a26b5fdf2d9926982.zip llvm-451741a9d778a260ceee608a26b5fdf2d9926982.tar.gz llvm-451741a9d778a260ceee608a26b5fdf2d9926982.tar.bz2 |
[lldb] Change Communication::SetConnection to take a unique_ptr
The function takes ownership of the object. This makes that explicit,
and avoids unowned pointers floating around.
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index a3c19f7..618ed7c 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -960,7 +960,7 @@ Status ProcessGDBRemote::ConnectToDebugserver(llvm::StringRef connect_url) { uint32_t retry_count = 0; while (!m_gdb_comm.IsConnected()) { if (conn_up->Connect(connect_url, &error) == eConnectionStatusSuccess) { - m_gdb_comm.SetConnection(conn_up.release()); + m_gdb_comm.SetConnection(std::move(conn_up)); break; } else if (error.WasInterrupted()) { // If we were interrupted, don't keep retrying. @@ -3482,7 +3482,8 @@ Status ProcessGDBRemote::LaunchAndConnectToDebugserver( // Our process spawned correctly, we can now set our connection to use // our end of the socket pair cleanup_our.release(); - m_gdb_comm.SetConnection(new ConnectionFileDescriptor(our_socket, true)); + m_gdb_comm.SetConnection( + std::make_unique<ConnectionFileDescriptor>(our_socket, true)); #endif StartAsyncThread(); } |