Improve memory management with layout engine

This commit is contained in:
Benjamin Johnson 2023-02-28 19:16:27 +11:00
parent f6f1a7ef82
commit 7b9bede733
2 changed files with 4 additions and 4 deletions

View file

@ -736,7 +736,9 @@ static NSMutableArray *activeConstraints = nil;
- (void) _bootstrapAutoLayout
{
[self _setLayoutEngine: [[GSAutoLayoutEngine alloc] init]];
GSAutoLayoutEngine *layoutEngine = [[GSAutoLayoutEngine alloc] init];
[self _setLayoutEngine: layoutEngine];
AUTORELEASE(layoutEngine);
}
@end

View file

@ -1128,8 +1128,6 @@ many times.
_f.cursor_rects_enabled = YES;
_f.cursor_rects_valid = NO;
_layoutEngine = nil;
/* Create the window view */
cframe.origin = NSZeroPoint;
cframe.size = _frame.size;
@ -6170,7 +6168,7 @@ current key view.<br />
- (void) _setLayoutEngine: (GSAutoLayoutEngine*)layoutEngine
{
_layoutEngine = layoutEngine;
ASSIGN(_layoutEngine, layoutEngine);
}
@end