Fix crash due to dictionary

This commit is contained in:
Gregory John Casamento 2019-08-14 04:30:52 -04:00
parent 8372fac3c0
commit 0f09fefac3
4 changed files with 13 additions and 11 deletions

View file

@ -92,10 +92,7 @@ NSAttributedString:
NSBundle:
- sharedFrameworksURL
- sharedSupportURL
- builtInPlugInsURL
- appStoreReceiptURL
- pathForAuxiliaryExecutable:
- privateFrameworksPath
- sharedFrameworksPath
- sharedSupportPath
+ URLsForResourcesWithExtension:subdirectory:inBundleWithURL:

View file

@ -33,7 +33,7 @@
extern "C" {
#endif
@class NSString, NSDictionary, NSArray, NSNumber, NSProgress;
@class NSString, NSDictionary, NSArray, NSNumber, NSURL, NSProgress;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_9, GS_API_LATEST)

View file

@ -96,7 +96,7 @@ static NSMutableDictionary *__subscribers = nil;
internal->_throughput = nil;
internal->_totalUnitCount = 0;
internal->_completedUnitCount = 0;
internal->_userInfo = [userInfo mutableCopy];
internal->_userInfo = RETAIN([userInfo mutableCopy]);
internal->_cancelled = NO;
internal->_cancellable = NO;
internal->_paused = NO;
@ -104,7 +104,6 @@ static NSMutableDictionary *__subscribers = nil;
internal->_indeterminate = NO;
internal->_finished = NO;
internal->_parent = parent; // this is a weak reference and not retained.
internal->_userInfo = [[NSMutableDictionary alloc] initWithCapacity: 10];
}
return self;
}
@ -209,8 +208,12 @@ static NSMutableDictionary *__subscribers = nil;
- (NSString *) localizedDescription
{
return [NSString stringWithFormat: @"%f percent complete",
[self fractionCompleted]];
return _localizedDescription;
}
- (void) setLocalizedDescription: (NSString *)localDescription
{
ASSIGNCOPY(_localizedDescription, localDescription);
}
- (NSString *) localizedAddtionalDescription
@ -219,6 +222,11 @@ static NSMutableDictionary *__subscribers = nil;
[self estimatedTimeRemaining]];
}
- (void) setLocalizedAdditionalDescription: (NSString *)localDescription
{
ASSIGNCOPY(_localizedAdditionalDescription, localDescription);
}
// Observing progress
- (double) fractionCompleted
{

View file

@ -5,9 +5,6 @@
int main()
{
id obj1;
id obj2;
NSMutableArray *testObjs = [[NSMutableArray alloc] init];
NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSDictionary *dict = [NSDictionary dictionary];
NSProgress *progress = [[NSProgress alloc] initWithParent: nil