From 9b8635767148b3f95942593bfeefa86f147d2c53 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Thu, 19 Dec 2013 21:30:10 +0000 Subject: Fix build of Mac GTM project with static analyzer. Remove GTMGarbageCollection. Remove GC build configs. Remove internal dependence on GTMObjectSingleton. DELTA=447 (49 added, 296 deleted, 102 changed) --- AppKit/GTMCarbonEvent.m | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'AppKit/GTMCarbonEvent.m') diff --git a/AppKit/GTMCarbonEvent.m b/AppKit/GTMCarbonEvent.m index 515a1e1..235306e 100644 --- a/AppKit/GTMCarbonEvent.m +++ b/AppKit/GTMCarbonEvent.m @@ -18,7 +18,6 @@ #import "GTMCarbonEvent.h" #import -#import "GTMObjectSingleton.h" #import "GTMDebugSelectorValidation.h" #import "GTMTypeCasting.h" @@ -477,8 +476,13 @@ static OSStatus EventHandler(EventHandlerCallRef inHandler, @implementation GTMCarbonEventMonitorHandler -GTMOBJECT_SINGLETON_BOILERPLATE(GTMCarbonEventMonitorHandler, - sharedEventMonitorHandler); ++ (GTMCarbonEventMonitorHandler *)sharedEventMonitorHandler { + static GTMCarbonEventMonitorHandler *obj = nil; + if (!obj) { + obj = [[self alloc] init]; + } + return obj; +} - (EventTargetRef)eventTarget { return GetEventMonitorTarget(); @@ -494,8 +498,13 @@ extern EventTargetRef GetApplicationEventTarget(void); @implementation GTMCarbonEventApplicationEventHandler -GTMOBJECT_SINGLETON_BOILERPLATE(GTMCarbonEventApplicationEventHandler, - sharedApplicationEventHandler); ++ (GTMCarbonEventApplicationEventHandler *)sharedApplicationEventHandler { + static GTMCarbonEventApplicationEventHandler *obj = nil; + if (!obj) { + obj = [[self alloc] init]; + } + return obj; +} - (EventTargetRef)eventTarget { return GetApplicationEventTarget(); @@ -505,8 +514,13 @@ GTMOBJECT_SINGLETON_BOILERPLATE(GTMCarbonEventApplicationEventHandler, @implementation GTMCarbonEventDispatcherHandler -GTMOBJECT_SINGLETON_BOILERPLATE(GTMCarbonEventDispatcherHandler, - sharedEventDispatcherHandler); ++ (GTMCarbonEventDispatcherHandler *)sharedEventDispatcherHandler { + static GTMCarbonEventDispatcherHandler *obj = nil; + if (!obj) { + obj = [[self alloc] init]; + } + return obj; +} // Register for the events we handle, and set up the dictionaries we need // to keep track of the hotkeys and commands that we handle. -- cgit v1.2.3