mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 23:17:21 -06:00
Don't use explicit memory management
And avoid dangling pointers.
This commit is contained in:
@@ -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 {};
|
||||
|
||||
Reference in New Issue
Block a user