Changeset 5375


Ignore:
Timestamp:
10/25/09 07:49:40 (2 years ago)
Author:
SvenDowideit
Message:

Item2286: lots of missing calls to Foswiki::finish(), will refactor in trunk - just cleaning in release branch

Location:
branches/Release01x00
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/Release01x00/MailerContrib/test/unit/MailerContrib/MailerContribSuite.pm

    r5293 r5375  
    7373    # Must create a new twiki to force re-registration of users 
    7474    $Foswiki::cfg{EnableEmail} = 1; 
     75    $this->{twiki}->finish(); 
    7576    $this->{twiki} = new Foswiki(); 
    7677    $this->{twiki}->net->setMailHandler( \&FoswikiFnTestCase::sentMail ); 
  • branches/Release01x00/UnitTestContrib/lib/Unit/TestRunner.pm

    r4912 r5375  
    55use Devel::Symdump; 
    66use Error qw(:try); 
     7#use Devel::Leak::Object qw{ GLOBAL_bless }; 
     8#$Devel::Leak::Object::TRACKSOURCELINES = 1; 
    79 
    810sub new { 
     
    101103            } 
    102104            foreach my $test (@tests) { 
     105                #Devel::Leak::Object::checkpoint(); 
    103106                print "\t$test\n"; 
    104107                $tester->set_up(); 
     
    127130            } 
    128131        } 
    129     } 
     132   } 
    130133 
    131134    if ( $this->{unexpected_failures} || $this->{unexpected_passes} ) { 
  • branches/Release01x00/UnitTestContrib/test/unit/AccessControlTests.pm

    r3824 r5375  
    2626    my $this = shift; 
    2727    $this->SUPER::set_up(); 
    28     $this->{twiki} = new Foswiki(); 
    2928 
    3029    $currUser = $Foswiki::cfg{DefaultUserLogin}; 
  • branches/Release01x00/UnitTestContrib/test/unit/ExceptionTests.pm

    r3005 r5375  
    108108    $this->assert_matches(qr/^the rat$/m, $output); 
    109109    $this->assert_matches(qr/^phlegm$/m, $output); 
     110     
     111    $session->finish(); 
    110112} 
    111113 
  • branches/Release01x00/UnitTestContrib/test/unit/FoswikiTestCase.pm

    r3983 r5375  
    159159        } 
    160160    } 
     161#    undef $this->{twiki}; 
    161162} 
    162163 
  • branches/Release01x00/UnitTestContrib/test/unit/RegisterTests.pm

    r3003 r5375  
    789789                      }); 
    790790    $query->path_info( "/$this->{users_web}/UserRegistration" ); 
     791    $this->{twiki}->finish(); 
    791792    $this->{twiki} = Foswiki->new($Foswiki::cfg{DefaultUserName}, $query); 
    792793    $this->{twiki}->net->setMailHandler(\&FoswikiFnTestCase::sentMail); 
  • branches/Release01x00/WysiwygPlugin/test/unit/WysiwygPlugin/TranslatorTests.pm

    r5358 r5375  
    21162116    } 
    21172117    $query->path_info("/Current/TestTopic"); 
     2118    $this->{session}->finish() if (defined($this->{session})); 
    21182119    $this->{session} = new Foswiki( undef, $query ); 
    21192120    $Foswiki::Plugins::SESSION = $this->{session}; 
  • branches/Release01x00/WysiwygPlugin/test/unit/WysiwygPlugin/WysiwygPluginTests.pm

    r4939 r5375  
    9494    $query->method('GET'); 
    9595 
    96     $Foswiki::Plugins::SESSION = new Foswiki( 'guest', $query ); 
     96        $this->{twiki}->finish(); 
     97    $this->{twiki} = new Foswiki( 'guest', $query ); 
     98    $Foswiki::Plugins::SESSION = $this->{twiki}; 
    9799 
    98100    # charset definition affects output, so it is a response method and 
     
    174176    $this->assert( $text eq $out, 
    175177        "'" . anal($out) . "' !=\n'" . anal($text) . "'" ); 
     178    $foswiki->finish(); 
    176179} 
    177180 
     
    226229    $this->assert_str_equals( $text, $out, 
    227230        "'" . anal($out) . "' !=\n'" . anal($text) . "'" ); 
     231    $foswiki->finish(); 
    228232} 
    229233 
  • branches/Release01x00/core/lib/Foswiki.pm

    r5296 r5375  
    13941394    $query ||= new Foswiki::Request(); 
    13951395    my $this = bless( { sandbox => 'Foswiki::Sandbox' }, $class ); 
     1396 
    13961397    $this->{request}  = $query; 
    13971398    $this->{cgiQuery} = $query;    # for backwards compatibility in contribs 
     
    17661767=begin TML 
    17671768 
     1769---++ ObjectMethod DESTROY() 
     1770 
     1771called by Perl when the Foswiki object goes out of scope 
     1772(maybe should be used kist to ASSERT that finish() was called.. 
     1773 
     1774=cut 
     1775 
     1776#sub DESTROY { 
     1777#    my $this = shift; 
     1778#    $this->finish(); 
     1779#} 
     1780 
     1781=begin TML 
     1782 
    17681783---++ ObjectMethod finish() 
    17691784Break circular references. 
     
    17791794    $_->finish() foreach values %{ $this->{forms} }; 
    17801795    $this->{plugins}->finish()   if $this->{plugins}; 
     1796    undef $this->{plugins}; 
    17811797    $this->{users}->finish()     if $this->{users}; 
     1798    undef $this->{users}; 
    17821799    $this->{prefs}->finish()     if $this->{prefs}; 
     1800    undef $this->{prefs}; 
    17831801    $this->{templates}->finish() if $this->{templates}; 
     1802    undef $this->{templates}; 
    17841803    $this->{renderer}->finish()  if $this->{renderer}; 
     1804    undef $this->{renderer}; 
    17851805    $this->{net}->finish()       if $this->{net}; 
     1806    undef $this->{net}; 
    17861807    $this->{store}->finish()     if $this->{store}; 
     1808    undef $this->{store}; 
    17871809    $this->{search}->finish()    if $this->{search}; 
     1810    undef $this->{search}; 
    17881811    $this->{attach}->finish()    if $this->{attach}; 
     1812    undef $this->{attach}; 
    17891813    $this->{security}->finish()  if $this->{security}; 
     1814    undef $this->{security}; 
    17901815    $this->{i18n}->finish()      if $this->{i18n}; 
    1791  
     1816    undef $this->{i18n}; 
     1817#TODO: the logger doesn't seem to have a finish... 
     1818#    $this->{logger}->finish()      if $this->{logger}; 
     1819    undef $this->{logger}; 
     1820     
    17921821    undef $this->{_HTMLHEADERS}; 
    17931822    undef $this->{request}; 
  • branches/Release01x00/core/lib/Foswiki/Prefs/PrefsCache.pm

    r1779 r5375  
    3232require Foswiki::Prefs::Parser; 
    3333 
     34#SMELL: I don't know why this is a global - and where it should be undef'd.. 
    3435use vars qw( $parser ); 
    3536 
     
    175176    } 
    176177 
    177     my $parser = new Foswiki::Prefs::Parser(); 
     178    $parser ||= new Foswiki::Prefs::Parser(); 
    178179    $parser->parseText( $meta->text(), $this, '' ); 
    179180    $parser->parseMeta( $meta, $this, '' ); 
  • branches/Release01x00/core/tools/extender.pl

    r5278 r5375  
    124124    } 
    125125    &$check_perl_module('CPAN'); 
     126     
     127    $session->finish(); 
     128    undef $session; 
    126129} 
    127130 
Note: See TracChangeset for help on using the changeset viewer.