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:
		@@ -17,6 +17,7 @@
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#include "StdAfx.h"
 | 
			
		||||
#include <wrl/client.h>
 | 
			
		||||
 | 
			
		||||
enum MeasureType
 | 
			
		||||
{
 | 
			
		||||
@@ -231,13 +232,13 @@ bool ShowContextMenu(HWND hwnd, std::wstring& path)
 | 
			
		||||
	if (!SUCCEEDED(result) || !id)
 | 
			
		||||
		return false;
 | 
			
		||||
 | 
			
		||||
	IShellFolder* iFolder = nullptr;
 | 
			
		||||
	Microsoft::WRL::ComPtr<IShellFolder> iFolder = nullptr;
 | 
			
		||||
	LPCITEMIDLIST idChild = nullptr;
 | 
			
		||||
	result = SHBindToParent(id, IID_IShellFolder, (void**)&iFolder, &idChild);
 | 
			
		||||
	if (!SUCCEEDED(result) || !iFolder)
 | 
			
		||||
		return false;
 | 
			
		||||
 | 
			
		||||
	IContextMenu* iMenu = nullptr;
 | 
			
		||||
	Microsoft::WRL::ComPtr<IContextMenu> iMenu = nullptr;
 | 
			
		||||
	result = iFolder->GetUIObjectOf(hwnd, 1, (const ITEMIDLIST **)&idChild, IID_IContextMenu, nullptr, (void**)&iMenu);
 | 
			
		||||
	if (!SUCCEEDED(result) || !iFolder)
 | 
			
		||||
		return false;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user