Use helper functions to construct smart pointers

This commit is contained in:
Chocobo1 2020-03-05 00:39:41 +08:00
parent ca01b049a6
commit 2157e500ef
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
7 changed files with 10 additions and 10 deletions

View file

@ -327,7 +327,7 @@ bool Utils::Fs::isNetworkFileSystem(const QString &path)
{
#if defined(Q_OS_WIN)
const std::wstring pathW {path.toStdWString()};
std::unique_ptr<wchar_t[]> volumePath {new wchar_t[path.length() + 1] {}};
auto volumePath = std::make_unique<wchar_t[]>(path.length() + 1);
if (!::GetVolumePathNameW(pathW.c_str(), volumePath.get(), (path.length() + 1)))
return false;