Changeset 3760
- Timestamp:
- 10/15/07 01:56:16 (7 months ago)
- Files:
-
- trunk/Chat Core/MVChatPluginManager.h (modified) (1 diff)
- trunk/Chat Core/MVChatPluginManager.m (modified) (4 diffs)
- trunk/Colloquy.xcodeproj/project.pbxproj (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Chat Core/MVChatPluginManager.h
r3344 r3760 5 5 @private 6 6 NSMutableArray *_plugins; 7 BOOL _reloadingPlugins; 7 8 } 8 9 + (MVChatPluginManager *) defaultManager; trunk/Chat Core/MVChatPluginManager.m
r3525 r3760 11 11 @implementation MVChatPluginManager 12 12 + (MVChatPluginManager *) defaultManager { 13 return ( sharedInstance ? sharedInstance : ( sharedInstance = [[self allocWithZone:nil] init] ) ); 13 if( ! sharedInstance ) { 14 sharedInstance = [self allocWithZone:nil]; 15 sharedInstance = [sharedInstance init]; 16 } 17 18 return sharedInstance; 14 19 } 15 20 … … 34 39 35 40 - (id) init { 36 if( ( self = [super init] ) ) { 37 _plugins = [[NSMutableArray allocWithZone:nil] init]; 38 [self performSelector:@selector(reloadPlugins) withObject:nil afterDelay:0.]; 39 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( applicationWillTerminate: ) name:NSApplicationWillTerminateNotification object:[NSApplication sharedApplication]]; 40 } 41 if( ! ( self = [super init] ) ) 42 return nil; 43 44 _plugins = [[NSMutableArray allocWithZone:nil] init]; 45 [self reloadPlugins]; 46 47 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( applicationWillTerminate: ) name:NSApplicationWillTerminateNotification object:[NSApplication sharedApplication]]; 48 41 49 return self; 42 50 } … … 60 68 61 69 - (void) reloadPlugins { 70 if( _reloadingPlugins ) return; 71 _reloadingPlugins = YES; 72 62 73 [[NSNotificationCenter defaultCenter] postNotificationName:MVChatPluginManagerWillReloadPluginsNotification object:self]; 63 74 … … 91 102 92 103 [[NSNotificationCenter defaultCenter] postNotificationName:MVChatPluginManagerDidReloadPluginsNotification object:self]; 104 105 _reloadingPlugins = NO; 93 106 } 94 107 trunk/Colloquy.xcodeproj/project.pbxproj
r3755 r3760 381 381 containerPortal = 0A60C15F0630D96D00DC6280 /* Chat Core.xcodeproj */; 382 382 proxyType = 1; 383 remoteGlobalIDString = 1C51B46E052DE0CB00BB459B /* Chat Core (Framework) */;383 remoteGlobalIDString = 1C51B46E052DE0CB00BB459B; 384 384 remoteInfo = "Chat Core (Framework)"; 385 385 };
