mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed leaking interfaces from 05d256c
This commit is contained in:
parent
05d256ced3
commit
4fd398ddfb
@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "StdAfx.h"
|
#include "StdAfx.h"
|
||||||
|
#include <wrl/client.h>
|
||||||
|
|
||||||
enum MeasureType
|
enum MeasureType
|
||||||
{
|
{
|
||||||
@ -231,13 +232,13 @@ bool ShowContextMenu(HWND hwnd, std::wstring& path)
|
|||||||
if (!SUCCEEDED(result) || !id)
|
if (!SUCCEEDED(result) || !id)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
IShellFolder* iFolder = nullptr;
|
Microsoft::WRL::ComPtr<IShellFolder> iFolder = nullptr;
|
||||||
LPCITEMIDLIST idChild = nullptr;
|
LPCITEMIDLIST idChild = nullptr;
|
||||||
result = SHBindToParent(id, IID_IShellFolder, (void**)&iFolder, &idChild);
|
result = SHBindToParent(id, IID_IShellFolder, (void**)&iFolder, &idChild);
|
||||||
if (!SUCCEEDED(result) || !iFolder)
|
if (!SUCCEEDED(result) || !iFolder)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
IContextMenu* iMenu = nullptr;
|
Microsoft::WRL::ComPtr<IContextMenu> iMenu = nullptr;
|
||||||
result = iFolder->GetUIObjectOf(hwnd, 1, (const ITEMIDLIST **)&idChild, IID_IContextMenu, nullptr, (void**)&iMenu);
|
result = iFolder->GetUIObjectOf(hwnd, 1, (const ITEMIDLIST **)&idChild, IID_IContextMenu, nullptr, (void**)&iMenu);
|
||||||
if (!SUCCEEDED(result) || !iFolder)
|
if (!SUCCEEDED(result) || !iFolder)
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user