Changeset 5373 for branches/Release01x00/core/tools/MemoryLeakTests.pl
- Timestamp:
- 10/24/09 11:33:52 (3 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/Release01x00/core/tools/MemoryLeakTests.pl
r1065 r5373 19 19 20 20 use strict; 21 use Devel::Monitor qw(:all); 21 use Devel::Leak::Object qw{ GLOBAL_bless }; 22 22 23 23 24 BEGIN { 24 use File::Spec; 25 26 unshift @INC, split(/:/, $ENV{FOSWIKI_LIBS} || '../lib' ); 27 28 # designed to be run within a SVN checkout area 29 my @path = split( /\/+/, File::Spec->rel2abs($0) ); 30 pop(@path); # the script name 31 32 while (scalar(@path) > 0) { 33 last if -d join( '/', @path).'/twikiplugins/BuildContrib'; 34 pop( @path ); 25 if ( defined $ENV{GATEWAY_INTERFACE} ) { 26 $Foswiki::cfg{Engine} = 'Foswiki::Engine::CGI'; 27 use CGI::Carp qw(fatalsToBrowser); 28 $SIG{__DIE__} = \&CGI::Carp::confess; 35 29 } 36 37 if(scalar(@path)) {38 unshift @INC, join( '/', @path ).'/lib';39 unshift @INC, join( '/', @path ).'/twikiplugins/BuildContrib/lib';30 else { 31 $Foswiki::cfg{Engine} = 'Foswiki::Engine::CLI'; 32 require Carp; 33 $SIG{__DIE__} = \&Carp::confess; 40 34 } 35 $ENV{FOSWIKI_ACTION} = 'view'; 36 @INC = ('../bin', grep { $_ ne '.' } @INC); 37 require 'setlib.cfg'; 41 38 } 42 39 … … 45 42 46 43 { 47 my $twiki = new Foswiki(); 48 $Foswiki::Plugins::SESSION = $twiki; 49 monitor('TWiki' => \$Foswiki::Plugins::SESSION ); 50 51 Foswiki::UI::run( \&Foswiki::UI::View::view ); 52 53 #NOTE that Foswiki::finish() is hiding many circular references by foricbly clearing 54 #them with the %$this = (); its worth commenting out this line once in a while to 55 #see if its gettign worse (56 are found as of Jun2006) 56 57 print_circular_ref(\$Foswiki::Plugins::SESSION ); 44 ## $Foswiki::Plugins::SESSION = new Foswiki(); 45 # Foswiki::UI::run( \&Foswiki::UI::View::view ); 46 # $Foswiki::Plugins::SESSION->finish(); 47 # undef $Foswiki::Plugins::SESSION; 48 $Foswiki::engine->run(); 58 49 } 59 50
Note: See TracChangeset
for help on using the changeset viewer.
