Index: src/OFApplication.h ================================================================== --- src/OFApplication.h +++ src/OFApplication.h @@ -67,11 +67,11 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, copy) OFString *programName; @property (readonly, copy) OFArray *arguments; @property (readonly, copy) OFDictionary *environment; -@property (retain) id delegate; +@property (assign) id delegate; #endif /** * \brief Returns the only OFApplication instance in the application. * Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -40,13 +40,11 @@ static OFApplication *app = nil; static void atexit_handler(void) { - id delegate = [app delegate]; - - [delegate applicationWillTerminate]; + [[app delegate] applicationWillTerminate]; } int of_application_main(int *argc, char **argv[], Class cls) { @@ -55,13 +53,14 @@ [app setArgumentCount: argc andArgumentValues: argv]; [app setDelegate: delegate]; - [(id)delegate release]; [app run]; + + [(id)delegate release]; return 0; } @implementation OFApplication @@ -229,16 +228,16 @@ OF_GETTER(environment, YES) } - (id )delegate { - OF_GETTER(delegate, YES) + return delegate; } - (void)setDelegate: (id )delegate_ { - OF_SETTER(delegate, delegate_, YES, NO) + delegate = delegate_; } - (void)run { [delegate applicationDidFinishLaunching]; @@ -256,11 +255,10 @@ - (void)dealloc { [arguments release]; [environment release]; - [(id)delegate release]; [super dealloc]; } @end Index: src/OFHTTPRequest.h ================================================================== --- src/OFHTTPRequest.h +++ src/OFHTTPRequest.h @@ -103,11 +103,11 @@ @property (copy) OFURL *URL; @property (assign) of_http_request_type_t requestType; @property (copy) OFString *queryString; @property (copy) OFDictionary *headers; @property (assign) BOOL redirectsFromHTTPSToHTTPAllowed; -@property (retain) id delegate; +@property (assign) id delegate; @property (assign) BOOL storesData; #endif /** * \brief Creates a new OFHTTPRequest. Index: src/OFHTTPRequest.m ================================================================== --- src/OFHTTPRequest.m +++ src/OFHTTPRequest.m @@ -101,11 +101,10 @@ - (void)dealloc { [URL release]; [queryString release]; [headers release]; - [(id)delegate release]; [super dealloc]; } - (void)setURL: (OFURL*)URL_ @@ -158,16 +157,16 @@ return redirectsFromHTTPSToHTTPAllowed; } - (void)setDelegate: (id )delegate_ { - OF_SETTER(delegate, delegate_, YES, NO) + delegate = delegate_; } - (id )delegate { - OF_GETTER(delegate, YES) + return delegate; } - (void)setStoresData: (BOOL)storesData_ { storesData = storesData_; Index: src/OFStreamObserver.h ================================================================== --- src/OFStreamObserver.h +++ src/OFStreamObserver.h @@ -91,11 +91,11 @@ #endif OFMutex *mutex; } #ifdef OF_HAVE_PROPERTIES -@property (retain) id delegate; +@property (assign) id delegate; #endif /** * \brief Creates a new OFStreamObserver. * Index: src/OFStreamObserver.m ================================================================== --- src/OFStreamObserver.m +++ src/OFStreamObserver.m @@ -45,12 +45,10 @@ #import "OFInitializationFailedException.h" #import "OFNotImplementedException.h" #import "OFOutOfRangeException.h" -#import "macros.h" - enum { QUEUE_ADD = 0, QUEUE_REMOVE = 1, QUEUE_READ = 0, QUEUE_WRITE = 2 @@ -159,11 +157,10 @@ - (void)dealloc { close(cancelFD[0]); close(cancelFD[1]); - [(id)delegate release]; [readStreams release]; [writeStreams release]; [queue release]; [queueInfo release]; [queueFDs release]; @@ -174,16 +171,16 @@ [super dealloc]; } - (id )delegate { - OF_GETTER(delegate, YES) + return delegate; } - (void)setDelegate: (id )delegate_ { - OF_SETTER(delegate, delegate_, YES, NO) + delegate = delegate_; } - (void)addStreamForReading: (OFStream*)stream { [mutex lock]; Index: src/OFXMLElementBuilder.h ================================================================== --- src/OFXMLElementBuilder.h +++ src/OFXMLElementBuilder.h @@ -107,11 +107,11 @@ OFMutableArray *stack; id delegate; } #ifdef OF_HAVE_PROPERTIES -@property (retain) id delegate; +@property (assign) id delegate; #endif /** * \brief Creates a new element builder. * Index: src/OFXMLElementBuilder.m ================================================================== --- src/OFXMLElementBuilder.m +++ src/OFXMLElementBuilder.m @@ -52,23 +52,22 @@ } - (void)dealloc { [stack release]; - [(id)delegate release]; [super dealloc]; } - (id )delegate { - OF_GETTER(delegate, YES) + return delegate; } - (void)setDelegate: (id )delegate_ { - OF_SETTER(delegate, delegate_, YES, NO) + delegate = delegate_; } - (void)parser: (OFXMLParser*)parser foundProcessingInstructions: (OFString*)pi { Index: src/OFXMLParser.h ================================================================== --- src/OFXMLParser.h +++ src/OFXMLParser.h @@ -168,11 +168,11 @@ BOOL finishedParsing; of_string_encoding_t encoding; } #ifdef OF_HAVE_PROPERTIES -@property (retain) id delegate; +@property (assign) id delegate; #endif /** * \brief Creates a new XML parser. * Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -34,12 +34,10 @@ #import "OFInitializationFailedException.h" #import "OFMalformedXMLException.h" #import "OFUnboundNamespaceException.h" -#import "macros.h" - typedef void (*state_function)(id, SEL, const char*, size_t*, size_t*); static SEL selectors[OF_XMLPARSER_NUM_STATES]; static state_function lookupTable[OF_XMLPARSER_NUM_STATES]; static OF_INLINE void @@ -211,12 +209,10 @@ return self; } - (void)dealloc { - [(id)delegate release]; - [cache release]; [name release]; [prefix release]; [namespaces release]; [attributes release]; @@ -227,16 +223,16 @@ [super dealloc]; } - (id )delegate { - OF_GETTER(delegate, YES) + return delegate; } - (void)setDelegate: (id )delegate_ { - OF_SETTER(delegate, delegate_, YES, NO) + delegate = delegate_; } - (void)parseBuffer: (const char*)buffer withLength: (size_t)length {