Skip to content

Commit

Permalink
Call GC on preview unloading (#1456)
Browse files Browse the repository at this point in the history
* Call GC collect on preview unloading

* Added github issue link
  • Loading branch information
udit3333 committed Mar 5, 2020
1 parent 22c76f9 commit c16e324
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules/previewpane/common/controls/FormHandlerControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ public virtual void Unload()
this.Controls.Clear();
});

// Call garbage collection at the time of unloading of Preview. This is to mitigate issue with WebBrowser Control not able to dispose properly.
// Which is preventing prevhost.exe to exit at the time of closing File explorer.
// Preview Handlers run in a separate process from PowerToys. This will not affect the performance of other modules.
// Mitigate the following Github issue: https://github.com/microsoft/PowerToys/issues/1468
GC.Collect();
}

/// <inheritdoc />
Expand Down

0 comments on commit c16e324

Please sign in to comment.