Skip to content
Snippets Groups Projects
Commit 7f9aefbd authored by George Nachman's avatar George Nachman
Browse files

Make iTermImageMarks serializable so we don't leak images after state restoration

parent d5c23f1f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -323,8 +323,10 @@ static NSString *const kIntervalLengthKey = @"Length";
Class theClass = NSClassFromString(className);
if ([theClass instancesRespondToSelector:@selector(initWithDictionary:)]) {
id<IntervalTreeObject> object = [[[theClass alloc] initWithDictionary:objectDict] autorelease];
Interval *interval = [Interval intervalWithDictionary:intervalDict];
[self addObject:object withInterval:interval];
if (object) {
Interval *interval = [Interval intervalWithDictionary:intervalDict];
[self addObject:object withInterval:interval];
}
}
}
}
Loading
Loading
Loading
Loading
@@ -11,7 +11,25 @@
 
@implementation iTermImageMark
 
#warning Serialize and deserialize these
- (instancetype)initWithDictionary:(NSDictionary *)dict {
self = [super init];
if (self) {
_imageCode = dict[@"imageCode"];
}
if (!_imageCode) {
return nil;
} else {
return self;
}
}
- (NSDictionary *)dictionaryValue {
if (_imageCode) {
return @{ @"imageCode": _imageCode };
} else {
return @{};
}
}
 
- (void)dealloc {
if (_imageCode) {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment