Skip to content

Commit 0c660dc

Browse files
GurliGebisdonho
authored andcommitted
Fix memory leak
Fix partially #18
1 parent 9efecd7 commit 0c660dc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

EditWithNppExplorerCommandHandler.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ IFACEMETHODIMP EditWithNppExplorerCommandHandler::Invoke(IShellItemArray* psiIte
5757
const wstring applicationName = GetNppExecutableFullPath();
5858
const wstring commandLine = GetCommandLine(itemName);
5959

60+
// Cleanup itemName, since we are done with it.
61+
if (itemName)
62+
{
63+
CoTaskMemFree(itemName);
64+
}
65+
66+
// Release the IShellItem pointer, since we are done with it as well.
67+
psi->Release();
68+
6069
STARTUPINFO si;
6170
PROCESS_INFORMATION pi;
6271

0 commit comments

Comments
 (0)