Skip to content

Commit 1939339

Browse files
Copilotdanmoseley
andauthored
Fix memory leak in IIS StartupHook by properly disposing PhysicalFileProvider (#63322)
* Initial plan * Fix memory leak in IIS StartupHook by properly disposing PhysicalFileProvider Co-authored-by: danmoseley <6385855+danmoseley@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: danmoseley <6385855+danmoseley@users.noreply.github.com>
1 parent 579d722 commit 1939339

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Servers/IIS/IIS/src/StartupHook.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ public static void Initialize()
4949
var iisConfigData = NativeMethods.HttpGetApplicationProperties();
5050
var contentRoot = iisConfigData.pwzFullApplicationPath.TrimEnd(Path.DirectorySeparatorChar);
5151

52+
using var fileProvider = new PhysicalFileProvider(contentRoot);
53+
5254
var model = ErrorPageModelBuilder.CreateErrorPageModel(
53-
new PhysicalFileProvider(contentRoot),
55+
fileProvider,
5456
logger: null,
5557
showDetailedErrors: true,
5658
exception);

0 commit comments

Comments
 (0)