From e469086f09492a377ccc6074e432ed80aaa2a2e6 Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Tue, 17 Feb 2026 14:19:29 +0100 Subject: [PATCH] [net] Correctly restore gFile. In the previous attempt to use TContext, TFile::TContext was used in an attempt to restore gFile. This, however, only restores gDirectory, and was therefore redundant with TDirectory::TContext. --- net/httpsniff/src/TRootSnifferFull.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/httpsniff/src/TRootSnifferFull.cxx b/net/httpsniff/src/TRootSnifferFull.cxx index 1ea46f6f20d6b..c9f265fb2f43e 100644 --- a/net/httpsniff/src/TRootSnifferFull.cxx +++ b/net/httpsniff/src/TRootSnifferFull.cxx @@ -342,7 +342,10 @@ Bool_t TRootSnifferFull::ProduceRootFile(const std::string &path, const std::str } TDirectory::TContext dirCtx{nullptr}; - TFile::TContext fileCtx{nullptr}; + struct RestoreGFile { + TFile *oldFile{gFile}; + ~RestoreGFile() { gFile = oldFile; } + } restoreGFile; { TMemFile memfile("dummy.file", "RECREATE");