Browse Source

* Check for session in DoneSession, avoids creation of a factory if none is needed.

git-svn-id: trunk@17595 -
michael 14 years ago
parent
commit
0fb7ad5a07
1 changed files with 4 additions and 3 deletions
  1. 4 3
      packages/fcl-web/src/base/fphttp.pp

+ 4 - 3
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;