diff --git a/SUAppcast.m b/SUAppcast.m index 990b3df7..b0d454b5 100644 --- a/SUAppcast.m +++ b/SUAppcast.m @@ -70,8 +70,11 @@ - (void)setUserAgentString:(NSString *)uas { - [userAgentString release]; - userAgentString = [uas copy]; + if (uas != userAgentString) + { + [userAgentString release]; + userAgentString = [uas copy]; + } } - (void)setDelegate:del diff --git a/SUAppcastItem.m b/SUAppcastItem.m index f04a14e1..28efc7c7 100644 --- a/SUAppcastItem.m +++ b/SUAppcastItem.m @@ -17,6 +17,7 @@ - (void)setTitle:(NSString *)aTitle { + if (title == aTitle) return; [title release]; title = [aTitle copy]; } @@ -26,6 +27,7 @@ - (void)setDate:(NSDate *)aDate { + if (date == aDate) return; [date release]; date = [aDate copy]; } @@ -35,6 +37,7 @@ - (void)setDescription:(NSString *)aDescription { + if (description == aDescription) return; [description release]; description = [aDescription copy]; } @@ -44,6 +47,7 @@ - (void)setReleaseNotesURL:(NSURL *)aReleaseNotesURL { + if (releaseNotesURL == aReleaseNotesURL) return; [releaseNotesURL release]; releaseNotesURL = [aReleaseNotesURL copy]; } @@ -53,6 +57,7 @@ - (void)setDSASignature:(NSString *)aDSASignature { + if (DSASignature == aDSASignature) return; [DSASignature release]; DSASignature = [aDSASignature copy]; } @@ -62,6 +67,7 @@ - (void)setFileURL:(NSURL *)aFileURL { + if (fileURL == aFileURL) return; [fileURL release]; fileURL = [aFileURL copy]; } @@ -71,6 +77,7 @@ - (void)setVersionString:(NSString *)s { + if (versionString == s) return; [versionString release]; versionString = [s copy]; } @@ -80,6 +87,7 @@ - (void)setDisplayVersionString:(NSString *)s { + if (displayVersionString == s) return; [displayVersionString release]; displayVersionString = [s copy]; } @@ -88,6 +96,7 @@ - (NSString *)minimumSystemVersion { return [[minimumSystemVersion retain] autorelease]; } - (void)setMinimumSystemVersion:(NSString *)systemVersionString { + if (minimumSystemVersion == systemVersionString) return; [minimumSystemVersion release]; minimumSystemVersion = [systemVersionString copy]; } diff --git a/SUStatusController.m b/SUStatusController.m index 0438fe7e..cd44910a 100644 --- a/SUStatusController.m +++ b/SUStatusController.m @@ -61,7 +61,11 @@ - (void)setButtonTitle:(NSString *)aButtonTitle target:target action:(SEL)action isDefault:(BOOL)isDefault { [self willChangeValueForKey:@"buttonTitle"]; - buttonTitle = [aButtonTitle copy]; + if (buttonTitle != aButtonTitle) + { + [buttonTitle release]; + buttonTitle = [aButtonTitle copy]; + } [self didChangeValueForKey:@"buttonTitle"]; [self window]; @@ -113,7 +117,11 @@ - (void)setStatusText:(NSString *)aStatusText { - statusText = [aStatusText copy]; + if (statusText != aStatusText) + { + [statusText release]; + statusText = [aStatusText copy]; + } } @end diff --git a/SUUpdater.m b/SUUpdater.m index 6ac26a7d..f9f311dd 100644 --- a/SUUpdater.m +++ b/SUUpdater.m @@ -223,6 +223,7 @@ static SUUpdater *sharedUpdater = nil; - (void)setHostBundle:(NSBundle *)hb { + if (hostBundle == hb) return; [hostBundle release]; hostBundle = [hb retain]; [[SUUserDefaults standardUserDefaults] setIdentifier:[hostBundle bundleIdentifier]]; diff --git a/SUUserDefaults.m b/SUUserDefaults.m index 39d71151..d6923f04 100644 --- a/SUUserDefaults.m +++ b/SUUserDefaults.m @@ -27,8 +27,11 @@ - (void)setIdentifier:(NSString *)anIdentifier { - [identifier autorelease]; - identifier = [anIdentifier copy]; + if (identifier != anIdentifier) + { + [identifier release]; + identifier = [anIdentifier copy]; + } } - (void)verifyIdentifier