Oops. Now, the clang static analyzer now flags this as a use-after-release. I need to release the plug-in bundle later; i.e, at the end of the method.
2 // GrowlWebKitPluginHandler.m
5 // Created by JKP on 03/11/2005.
6 // Copyright 2005-2006 The Growl Project. All rights reserved.
9 #import "GrowlWebKitPluginHandler.h"
10 #import "GrowlWebKitDisplayPlugin.h"
11 #import "GrowlPluginController.h"
13 @implementation GrowlWebKitPluginHandler
15 - (id) initSingleton {
16 if ((self = [super initSingleton]))
17 [[GrowlPluginController sharedController] addPluginHandler:self forPluginTypes:[NSSet setWithObject:GROWL_STYLE_EXTENSION]];
22 - (BOOL) loadPluginAtPath:(NSString *)path {
23 NSBundle *pluginBundle = [[NSBundle alloc] initWithPath:path];
25 NSLog(@"%@ Failed to load: %@",NSStringFromClass([self class]),path);
29 GrowlWebKitDisplayPlugin *instance = [[GrowlWebKitDisplayPlugin alloc] initWithStyleBundle:pluginBundle];
31 NSLog(@"%@ Failed to load: %@ - the bundle did not contain a valid WebKit plugin",
32 NSStringFromClass([self class]),
37 [[GrowlPluginController sharedController] addPluginInstance:instance fromBundle:pluginBundle];
39 [pluginBundle release];