mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-10 23:42:46 -07:00
Use helper functions to construct smart pointers
This commit is contained in:
parent
ca01b049a6
commit
2157e500ef
7 changed files with 10 additions and 10 deletions
|
@ -126,7 +126,7 @@ void Utils::Misc::shutdownComputer(const ShutdownDialogAction &action)
|
|||
}
|
||||
else {
|
||||
const QString msg = QCoreApplication::translate("misc", "qBittorrent will shutdown the computer now because all downloads are complete.");
|
||||
std::unique_ptr<wchar_t[]> msgWchar(new wchar_t[msg.length() + 1] {});
|
||||
auto msgWchar = std::make_unique<wchar_t[]>(msg.length() + 1);
|
||||
msg.toWCharArray(msgWchar.get());
|
||||
::InitiateSystemShutdownW(nullptr, msgWchar.get(), 10, true, false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue