mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 12:59:56 -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
|
|
@ -114,9 +114,9 @@ namespace
|
|||
{
|
||||
QPixmap pixmapForExtension(const QString &ext) const override
|
||||
{
|
||||
const QString extWithDot = QLatin1Char('.') + ext;
|
||||
const std::wstring extWStr = QString(u'.' + ext).toStdWString();
|
||||
SHFILEINFO sfi {};
|
||||
HRESULT hr = ::SHGetFileInfoW(extWithDot.toStdWString().c_str(),
|
||||
HRESULT hr = ::SHGetFileInfoW(extWStr.c_str(),
|
||||
FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_ICON | SHGFI_USEFILEATTRIBUTES);
|
||||
if (FAILED(hr))
|
||||
return {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue