From 0fb7ad5a07672a7356e2b8f73f44b0ba3f1ee0da Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 28 May 2011 09:11:04 +0000 Subject: [PATCH] * Check for session in DoneSession, avoids creation of a factory if none is needed. git-svn-id: trunk@17595 - --- packages/fcl-web/src/base/fphttp.pp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/fcl-web/src/base/fphttp.pp b/packages/fcl-web/src/base/fphttp.pp index e160477fb6..f2cf5929b7 100644 --- a/packages/fcl-web/src/base/fphttp.pp +++ b/packages/fcl-web/src/base/fphttp.pp @@ -630,7 +630,9 @@ end; procedure TSessionHTTPModule.DoneSession; begin // Session manager may or may not destroy the session. - SessionFactory.DoneSession(FSession); + // Check if we actually have + if Assigned(FSession) then + SessionFactory.DoneSession(FSession); // In each case, our reference is no longer valid. FSession:=Nil; end; @@ -638,8 +640,7 @@ end; destructor TSessionHTTPModule.destroy; begin // Prevent memory leaks. - If Assigned(FSession) then - DoneSession; + DoneSession; inherited destroy; end;