mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 07:46:17 -07:00
Don't use explicit memory management
And avoid dangling pointers.
This commit is contained in:
parent
8a708fd97e
commit
bbd936fdfa
9 changed files with 28 additions and 36 deletions
|
@ -31,6 +31,8 @@
|
|||
#include <optional>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <memory>
|
||||
|
||||
#include <windows.h>
|
||||
#include <powrprof.h>
|
||||
#include <Shlobj.h>
|
||||
|
@ -393,7 +395,7 @@ QString Utils::Misc::getUserIDString()
|
|||
const int UNLEN = 256;
|
||||
WCHAR buffer[UNLEN + 1] = {0};
|
||||
DWORD buffer_len = sizeof(buffer) / sizeof(*buffer);
|
||||
if (GetUserNameW(buffer, &buffer_len))
|
||||
if (::GetUserNameW(buffer, &buffer_len))
|
||||
uid = QString::fromWCharArray(buffer);
|
||||
#else
|
||||
uid = QString::number(getuid());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue