Skip to content

Commit 1174be2

Browse files
committed
fix memory leak (cocos2d#20110)
1 parent 4003802 commit 1174be2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cocos/ui/UIVideoPlayer-ios.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ @implementation UIVideoViewWrapperIos
8787
-(id)init:(void*)videoPlayer
8888
{
8989
if (self = [super init]) {
90-
self.playerController = [AVPlayerViewController new];
90+
self.playerController = [[AVPlayerViewController new] autorelease];
9191

9292
[self setRepeatEnabled:FALSE];
9393
[self showPlaybackControls:TRUE];

cocos/ui/UIWebView/UIWebViewImpl-ios.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ - (void)dealloc {
124124

125125
- (void)setupWebView {
126126
if (!self.wkWebView) {
127-
self.wkWebView = [[WKWebView alloc] init];
127+
self.wkWebView = [[[WKWebView alloc] init] autorelease];
128128
self.wkWebView.UIDelegate = self;
129129
self.wkWebView.navigationDelegate = self;
130130
}

0 commit comments

Comments
 (0)