Changeset 3736

Show
Ignore:
Timestamp:
09/18/07 21:24:11 (10 months ago)
Author:
timothy
Message:

Fixes JavaScript? plugins.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Plug-Ins/JavaScript Support/JVJavaScriptChatPlugin.h

    r3667 r3736  
    1515        BOOL _loading; 
    1616        BOOL _errorShown; 
    17         BOOL _scriptGlobalsRemoved; 
     17        BOOL _scriptGlobalsAdded; 
    1818} 
    1919- (id) initWithScriptAtPath:(NSString *) path withManager:(MVChatPluginManager *) manager; 
  • trunk/Plug-Ins/JavaScript Support/JVJavaScriptChatPlugin.m

    r3667 r3736  
    101101 
    102102- (void) release { 
    103         if( ( [self retainCount] - 1 ) == 1 && !_scriptGlobalsRemoved ) 
     103        if( ( [self retainCount] - 1 ) == 1 && _scriptGlobalsAdded ) 
    104104                [self performSelector:@selector(removeScriptGlobalsForWebView:) withObject:_webview afterDelay:0]; 
    105105        [super release]; 
     
    226226 
    227227- (void) setupScriptGlobalsForWebView:(WebView *) webView { 
    228         _scriptGlobalsRemoved = NO; 
     228        if (!webView) 
     229                return; 
     230 
     231        _scriptGlobalsAdded = YES; 
    229232 
    230233        [[webView windowScriptObject] setValue:self forKey:@"Plugin"]; 
     
    239242 
    240243- (void) removeScriptGlobalsForWebView:(WebView *) webView { 
    241         if (!webView && !_scriptGlobalsRemoved) 
     244        if (!webView || !_scriptGlobalsAdded) 
    242245                return; 
    243246 
    244         _scriptGlobalsRemoved = YES
     247        _scriptGlobalsAdded = NO
    245248 
    246249        [[webView windowScriptObject] removeWebScriptKey:@"Plugin"];