Author: stas Date: Tue Feb 8 17:39:28 2005 New Revision: 152974 URL: http://svn.apache.org/viewcvs?view=rev&rev=152974 Log: remove the previously added temporary storage of the str() output in a lexical variable. apparently it doesn't make any difference on win32. [Steve Hay <[EMAIL PROTECTED]>]
Modified: perl/modperl/trunk/xs/APR/Error/Error_pm Modified: perl/modperl/trunk/xs/APR/Error/Error_pm URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/xs/APR/Error/Error_pm?view=diff&r1=152973&r2=152974 ============================================================================== --- perl/modperl/trunk/xs/APR/Error/Error_pm (original) +++ perl/modperl/trunk/xs/APR/Error/Error_pm Tue Feb 8 17:39:28 2005 @@ -30,15 +30,9 @@ # - the filename and line number are needed because perl doesn't # provide that info when exception objects are involved sub str { - # This function is called by SvTRUE in modperl_errsv() via - # overload and on win32 (and randomly on linux) causes crashes - # via: "Attempt to free temp prematurely" warning, where this - # 'temp' is the string returned by this function. Making it a - # lexical variable before returning it, resolves the problem - my $str = sprintf "%s: (%d) %s at %s line %d", $_[0]->{func}, + return sprintf "%s: (%d) %s at %s line %d", $_[0]->{func}, $_[0]->{rc}, APR::Error::strerror($_[0]->{rc}), $_[0]->{file}, $_[0]->{line}; - return $str; } sub num { $_[0]->{rc} }