Skip to content

Commit

Permalink
fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
hxxft committed May 11, 2018
1 parent 8372ed2 commit 95d72d1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions iOS/lynx/widget/body/lynx_content_view.mm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include "config/global_config_data.h"
#include "parser/render_parser.h"


#include "base/log/logging.h"
using namespace lynx;

@implementation LxContentView
Expand All @@ -33,9 +35,8 @@ -(id) initWithFrame:(CGRect)frame {
[_renderTreeHostImpl updateViewport:frame];

// Connect RenderTreeHost and BodyView
LynxUI* ui = [[_renderTreeHostImpl rootRenderObjectImpl] createLynxUI];
LxUIBody* LxUIBody = ui;
[LxUIBody resetView:self];
_uiBody = (LxUIBody*)[[_renderTreeHostImpl rootRenderObjectImpl] createLynxUI];
[_uiBody resetView:self];

// Create FrameRateController
_controller = [[LynxFrameRateController alloc] initWithVSyncListener:_renderTreeHostImpl];
Expand Down Expand Up @@ -110,7 +111,9 @@ -(void)didMoveToWindow {
}

- (void)destroy {
// [_runtime destroy];
[_runtime destroy];
_runtime = nil;
_renderTreeHostImpl = nil;
}

@end

0 comments on commit 95d72d1

Please sign in to comment.