Browse Source

* Set the global CustomApplication variable, usefull for logging

git-svn-id: trunk@15622 -
joost 15 years ago
parent
commit
c024cbfb4c

+ 6 - 0
packages/fcl-web/src/base/fpapache.pp

@@ -164,6 +164,8 @@ Var
 
 Implementation
 
+uses CustApp;
+
 resourcestring
   SErrNoModuleNameForRequest = 'Could not determine HTTP module name for request';
   SErrNoModuleForRequest = 'Could not determine HTTP module for request "%s"';
@@ -180,12 +182,16 @@ Procedure InitApache;
 
 begin
   Application:=TCustomApacheApplication.Create(Nil);
+  if not assigned(CustomApplication) then
+    CustomApplication := Application;
 end;
 
 Procedure DoneApache;
 
 begin
   Try
+    if CustomApplication=Application then
+      CustomApplication := nil;
     FreeAndNil(Application);
   except
     if ShowCleanUpErrors then

+ 4 - 1
packages/fcl-web/src/base/fpcgi.pp

@@ -38,13 +38,16 @@ Procedure InitCGI;
 
 begin
   Application:=TCGIApplication.Create(Nil);
-  CustomApplication:=Application;
+  if not assigned(CustomApplication) then
+    CustomApplication := Application;
 end;
 
 Procedure DoneCGI;
 
 begin
   Try
+    if CustomApplication=Application then
+      CustomApplication := nil;
     FreeAndNil(Application);
   except
     if ShowCleanUpErrors then

+ 6 - 0
packages/fcl-web/src/base/fpfcgi.pp

@@ -31,16 +31,22 @@ Var
   
 Implementation
 
+uses CustApp;
+
 Procedure InitFCGI;
 
 begin
   Application:=TFCGIApplication.Create(Nil);
+  if not assigned(CustomApplication) then
+    CustomApplication := Application;
 end;
 
 Procedure DoneFCGI;
 
 begin
   Try
+    if CustomApplication=Application then
+      CustomApplication := nil;
     FreeAndNil(Application);
   except
     if ShowCleanUpErrors then