mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -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
|
@ -164,7 +164,8 @@ void Utils::Gui::openFolderSelect(const Path &path)
|
|||
{
|
||||
if (SUCCEEDED(::CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE)))
|
||||
{
|
||||
PIDLIST_ABSOLUTE pidl = ::ILCreateFromPathW(reinterpret_cast<const wchar_t *>(path.toString().utf16()));
|
||||
const std::wstring pathWStr = path.toString().toStdWString();
|
||||
PIDLIST_ABSOLUTE pidl = ::ILCreateFromPathW(pathWStr.c_str());
|
||||
if (pidl)
|
||||
{
|
||||
::SHOpenFolderAndSelectItems(pidl, 0, nullptr, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue