Changeset c8d9f84


Ignore:
Timestamp:
Sep 25, 2010, 10:26:08 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
e75a6df
Parents:
b120bd3
git-author:
David Benjamin <davidben@mit.edu> (09/24/10 17:34:51)
git-committer:
David Benjamin <davidben@mit.edu> (09/25/10 22:26:08)
Message:
More aggressively stop Timers created in perl

In case something leaks with references or whatever, at least we don't
leak timers.
Location:
perl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl/MainLoopCompatHook.pm

    r3aa0522 rc8d9f84  
    3737}
    3838
     39sub DESTROY {
     40    my $self = shift;
     41    $self->clear();
     42}
     43
    3944sub _ensure_timer {
    4045  my $self = shift;
  • perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm

    r416241f rc8d9f84  
    319319    my $weak = $self;
    320320    weaken($weak);
     321    if (defined $self->{reconnect_timer}) {
     322        $self->{reconnect_timer}->stop;
     323    }
    321324    $self->{reconnect_timer} =
    322325        BarnOwl::Timer->new( {
     
    331334    my $self = shift;
    332335    delete $BarnOwl::Module::IRC::reconnect{$self->alias};
     336    if (defined $self->{reconnect_timer}) {
     337        $self->{reconnect_timer}->stop;
     338    }
    333339    delete $self->{reconnect_timer};
    334340}
  • perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm

    r2f25537 rc8d9f84  
    112112    if ( !$conn->connected() ) {
    113113        # We don't need this timer any more.
     114        if (defined $vars{keepAliveTimer}) {
     115            $vars{keepAliveTimer}->stop;
     116        }
    114117        delete $vars{keepAliveTimer};
    115118        return;
  • perl/modules/Twitter/lib/BarnOwl/Module/Twitter/Handle.pm

    r10dd8e6 rc8d9f84  
    149149    my $weak = $self;
    150150    weaken($weak);
     151
     152    # Stop any existing timers.
     153    if (defined $self->{timer}) {
     154        $self->{timer}->stop;
     155        $self->{timer} = undef;
     156    }
     157    if (defined $self->{direct_timer}) {
     158        $self->{direct_timer}->stop;
     159        $self->{direct_timer} = undef;
     160    }
    151161
    152162    if($self->{cfg}->{poll_for_tweets}) {
Note: See TracChangeset for help on using the changeset viewer.