Ignore:
Timestamp:
May 17, 2010, 9:44:01 PM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.10, release-1.7, release-1.8, release-1.9
Children:
bacf674
Parents:
d544237
git-author:
Nelson Elhage <nelhage@mit.edu> (05/16/10 11:51:25)
git-committer:
Nelson Elhage <nelhage@mit.edu> (05/17/10 21:44:01)
Message:
Allow explicitly cancelling timers from perl.
File:
1 edited

Legend:

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

    ree183be r8d16e58  
    2121}
    2222
     23sub stop {
     24    my $self = shift;
     25    if(defined($self->{timer})) {
     26        BarnOwl::Internal::remove_timer($self->{timer});
     27        undef $self->{timer};
     28    }
     29}
     30
    2331sub do_callback {
    2432    my $self = shift;
     
    2836sub DESTROY {
    2937    my $self = shift;
    30     if(defined($self->{timer})) {
    31         BarnOwl::Internal::remove_timer($self->{timer});
    32     }
     38    $self->stop;
    3339}
    3440
Note: See TracChangeset for help on using the changeset viewer.