Changeset 9765


Ignore:
Timestamp:
12/17/09 23:18:10 (2 years ago)
Author:
azawawi
Message:

Fixed Padre crash when closing a Perl 5 script tab quickly while syntax check is on

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Task/SyntaxChecker.pm

    r9729 r9765  
    8989    } 
    9090    return () if not defined $editor; 
     91    $editor = Scalar::Util::refaddr( $editor ); 
    9192    $self->{main_thread_only}->{on_finish} = $on_finish if $on_finish; 
    9293    $self->{main_thread_only}->{editor} = $editor; 
     
    127128    my $main     = Padre->ide->wx->main; 
    128129    my $syntax   = $main->syntax; 
    129     my $editor   = $self->{main_thread_only}->{editor}; 
     130 
     131    my $editor = Padre::Current->editor; 
     132    my $addr   = delete $self->{main_thread_only}->{editor}; 
     133    if ( not $addr or not $editor or $addr ne Scalar::Util::refaddr($editor) ) { 
     134        # editor reference is not valid any more 
     135        return 1; 
     136    } 
    130137 
    131138    # Clear out the existing stuff 
    132139    $syntax->clear; 
    133  
    134     require Padre::Wx; 
    135140 
    136141    # If there are no errors, clear the synax checker pane and return. 
Note: See TracChangeset for help on using the changeset viewer.