Don't use explicit memory management

And avoid dangling pointers.
Original PR #16705.
This commit is contained in:
Chocobo1
2022-03-27 14:17:42 +08:00
committed by GitHub
parent ede7c8acbb
commit c621cae43b
9 changed files with 28 additions and 38 deletions

View File

@@ -279,8 +279,9 @@ namespace
if (!uuid.isNull())
return uuid.toString().toUpper(); // Libtorrent expects the GUID in uppercase
const std::wstring nameWStr = name.toStdWString();
NET_LUID luid {};
const LONG res = ::ConvertInterfaceNameToLuidW(name.toStdWString().c_str(), &luid);
const LONG res = ::ConvertInterfaceNameToLuidW(nameWStr.c_str(), &luid);
if (res == 0)
{
GUID guid;