dougm       00/12/19 22:39:48

  Modified:    .        Changes
               src/modules/perl mod_perl.c
  Log:
  stop win32 crash when bringing down service
  
  Revision  Changes    Path
  1.551     +3 -0      modperl/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.550
  retrieving revision 1.551
  diff -u -r1.550 -r1.551
  --- Changes   2000/12/20 06:34:19     1.550
  +++ Changes   2000/12/20 06:39:47     1.551
  @@ -10,6 +10,9 @@
   
   =item 1.24_02-dev
   
  +stop win32 crash when bringing down service
  +[John K. Sterling <[EMAIL PROTECTED]>]
  +
   various Apache::test enhancements and fixes
   [Ken Williams <[EMAIL PROTECTED]>, Dave Rolsky <[EMAIL PROTECTED]>]
   
  
  
  
  1.134     +15 -1     modperl/src/modules/perl/mod_perl.c
  
  Index: mod_perl.c
  ===================================================================
  RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.c,v
  retrieving revision 1.133
  retrieving revision 1.134
  diff -u -r1.133 -r1.134
  --- mod_perl.c        2000/10/06 20:18:28     1.133
  +++ mod_perl.c        2000/12/20 06:39:48     1.134
  @@ -507,7 +507,21 @@
   
   static void mp_dso_unload(void *data) 
   { 
  -    array_header *librefs = xs_dl_librefs((pool *)data);
  +    array_header *librefs;
  +
  +#ifdef WIN32
  +    // This is here to stop a crash when bringing down
  +    // a service.  Apparently the dso is unloaded too early.
  +    // This if statement tests to see if we are running as a 
  +    // service. apache does the same
  +    // see apache's isProcessService() in service.c 
  +    if (AllocConsole()) {
  +        FreeConsole();
  +        return;
  +    } 
  +#endif
  +
  +    librefs = xs_dl_librefs((pool *)data);
       perl_shutdown(NULL, NULL);
       unload_xs_so(librefs);
   } 
  
  
  

Reply via email to