Don't use explicit memory management

And avoid dangling pointers.
This commit is contained in:
Chocobo1 2022-03-23 15:27:47 +08:00
parent 8a708fd97e
commit bbd936fdfa
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
9 changed files with 28 additions and 36 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;