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 "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;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user