perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: modperl-2.0/src/modules/perl modperl_io.c
Date Sun, 06 Jan 2002 21:56:22 GMT
dougm       02/01/06 13:56:22

  Modified:    src/modules/perl modperl_io.c
  Log:
  always call modperl_io_handle_untie() in modperl_io_handle_tie()
  fixes a segv in modules/cgi test #1
  
  Revision  Changes    Path
  1.5       +14 -7     modperl-2.0/src/modules/perl/modperl_io.c
  
  Index: modperl_io.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_io.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- modperl_io.c	13 Sep 2001 04:10:55 -0000	1.4
  +++ modperl_io.c	6 Jan 2002 21:56:22 -0000	1.5
  @@ -15,12 +15,21 @@
    */
   MP_INLINE void modperl_io_handle_untie(pTHX_ GV *handle)
   {
  +#ifdef MP_TRACE
  +    if (mg_find((SV*)handle, 'q') ||
  +        mg_find((SV*)GvIOp(handle), 'q'))
  +    {
  +        MP_TRACE_g(MP_FUNC, "untie *%s(0x%lx), REFCNT=%d\n",
  +                   GvNAME(handle), (unsigned long)handle,
  +                   SvREFCNT((SV*)handle));
  +    }
  +    else {
  +        return;
  +    }
  +#endif
  +
       sv_unmagic((SV*)handle, 'q');
       sv_unmagic((SV*)GvIOp(handle), 'q');
  -
  -    MP_TRACE_g(MP_FUNC, "untie *%s(0x%lx), REFCNT=%d\n",
  -               GvNAME(handle), (unsigned long)handle,
  -               SvREFCNT((SV*)handle));
   }
   
   MP_INLINE void modperl_io_handle_tie(pTHX_ GV *handle,
  @@ -28,9 +37,7 @@
   {
       SV *obj = modperl_ptr2obj(aTHX_ classname, ptr);
   
  -    if (mg_find((SV*)handle, 'q')) {
  -        modperl_io_handle_untie(aTHX_ handle);
  -    }
  +    modperl_io_handle_untie(aTHX_ handle);
   
       sv_magic((SV*)handle, obj, 'q', Nullch, 0);
       sv_magic((SV*)GvIOp(handle), obj, 'q', Nullch, 0);
  
  
  

Mime
View raw message