Skip to content

Commit 0b221a8

Browse files
committed
Fix searchbox memory leaks
1 parent d910263 commit 0b221a8

File tree

5 files changed

+18
-0
lines changed

5 files changed

+18
-0
lines changed

ProcessHacker/prpgenv.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,8 @@ VOID PhpDeleteEnvironmentTree(
12331233
_In_ PPH_ENVIRONMENT_CONTEXT Context
12341234
)
12351235
{
1236+
PhDeleteTreeNewFilterSupport(&Context->TreeFilterSupport);
1237+
12361238
for (ULONG i = 0; i < Context->NodeList->Count; i++)
12371239
{
12381240
PhpDestroyEnvironmentNode(Context->NodeList->Items[i]);
@@ -1331,6 +1333,9 @@ INT_PTR CALLBACK PhpProcessEnvironmentDlgProc(
13311333
break;
13321334
case WM_DESTROY:
13331335
{
1336+
PhRemoveTreeNewFilter(&context->TreeFilterSupport, context->TreeFilterEntry);
1337+
if (context->SearchboxText) PhDereferenceObject(context->SearchboxText);
1338+
13341339
PhSaveSettingsEnvironmentList(context);
13351340
PhpDeleteEnvironmentTree(context);
13361341

ProcessHacker/prpghndl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,9 @@ INT_PTR CALLBACK PhpProcessHandlesDlgProc(
438438
break;
439439
case WM_DESTROY:
440440
{
441+
PhRemoveTreeNewFilter(&handlesContext->ListContext.TreeFilterSupport, handlesContext->FilterEntry);
442+
if (handlesContext->SearchboxText) PhDereferenceObject(handlesContext->SearchboxText);
443+
441444
PhEmCallObjectOperation(EmHandlesContextType, handlesContext, EmObjectDelete);
442445

443446
PhUnregisterCallback(

ProcessHacker/prpgmem.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,10 @@ INT_PTR CALLBACK PhpProcessMemoryDlgProc(
423423
break;
424424
case WM_DESTROY:
425425
{
426+
PhRemoveTreeNewFilter(&memoryContext->ListContext.TreeFilterSupport, memoryContext->FilterEntry);
427+
PhRemoveTreeNewFilter(&memoryContext->ListContext.TreeFilterSupport, memoryContext->AllocationFilterEntry);
428+
if (memoryContext->SearchboxText) PhDereferenceObject(memoryContext->SearchboxText);
429+
426430
PhEmCallObjectOperation(EmMemoryContextType, memoryContext, EmObjectDelete);
427431

428432
if (PhPluginsEnabled)

ProcessHacker/prpgmod.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,9 @@ INT_PTR CALLBACK PhpProcessModulesDlgProc(
496496
break;
497497
case WM_DESTROY:
498498
{
499+
PhRemoveTreeNewFilter(&modulesContext->ListContext.TreeFilterSupport, modulesContext->FilterEntry);
500+
if (modulesContext->SearchboxText) PhDereferenceObject(modulesContext->SearchboxText);
501+
499502
PhEmCallObjectOperation(EmModulesContextType, modulesContext, EmObjectDelete);
500503

501504
PhUnregisterCallback(

plugins/WindowExplorer/wndtree.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ VOID WeDeleteWindowTree(
187187
PPH_STRING settings;
188188
ULONG i;
189189

190+
PhRemoveTreeNewFilter(&Context->FilterSupport, Context->TreeFilterEntry);
191+
if (Context->SearchboxText) PhDereferenceObject(Context->SearchboxText);
192+
190193
PhDeleteTreeNewFilterSupport(&Context->FilterSupport);
191194

192195
settings = PhCmSaveSettings(Context->TreeNewHandle);

0 commit comments

Comments
 (0)