Commit cf0875cc authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

MacOSX/Framework/VLCTime.m: Fix a segfault because of a missing retain. Create...

MacOSX/Framework/VLCTime.m: Fix a segfault because of a missing retain. Create a real null time. Code simplification.
parent b095d5f2
...@@ -30,7 +30,7 @@ static VLCTime *nullTime = nil; ...@@ -30,7 +30,7 @@ static VLCTime *nullTime = nil;
+ (VLCTime *)nullTime + (VLCTime *)nullTime
{ {
if (!nullTime) if (!nullTime)
nullTime = [VLCTime timeWithNumber:[NSNumber numberWithInt:0]]; nullTime = [[VLCTime timeWithNumber:nil] retain];
return nullTime; return nullTime;
} }
...@@ -76,10 +76,7 @@ static VLCTime *nullTime = nil; ...@@ -76,10 +76,7 @@ static VLCTime *nullTime = nil;
- (NSNumber *)numberValue - (NSNumber *)numberValue
{ {
if (value) return value ? [value copy] : nil;
return [value copy];
else
return nil;
} }
- (NSString *)stringValue - (NSString *)stringValue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment