Changeset 9618


Ignore:
Timestamp:
Nov 28, 2009, 9:01:27 PM (13 years ago)
Author:
livings124
Message:

add a lock to the message lock code

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/MessageWindowController.h

    r9617 r9618  
    3737   
    3838    NSTimer * fTimer;
     39   
     40    NSLock * fLock;
    3941}
    4042
  • trunk/macosx/MessageWindowController.m

    r9617 r9618  
    5151{
    5252    [fTimer invalidate];
     53    [fLock release];
     54   
    5355    [fMessages release];
    5456    [fDisplayedMessages release];
     
    124126    fMessages = [[NSMutableArray alloc] init];
    125127    fDisplayedMessages = [[NSMutableArray alloc] init];
     128   
     129    fLock = [[NSLock alloc] init];
    126130}
    127131
     
    147151   
    148152    static NSUInteger currentIndex = 0;
     153   
     154    [fLock lock];
    149155   
    150156    NSScroller * scroller = [[fMessageTable enclosingScrollView] verticalScroller];
     
    190196            [fMessageTable scrollRowToVisible: [fDisplayedMessages count]-1];
    191197    }
     198   
     199    [fLock unlock];
    192200}
    193201
     
    304312        return;
    305313   
     314    [fLock lock];
     315   
    306316    [[NSUserDefaults standardUserDefaults] setInteger: level forKey: @"MessageLevel"];
    307317   
     
    320330    [fMessageTable deselectAll: nil];
    321331    [fMessageTable reloadData];
     332   
     333    [fLock unlock];
    322334}
    323335
Note: See TracChangeset for help on using the changeset viewer.