Skip to content

Commit 796e09f

Browse files
dave-oriminggo
authored andcommitted
UIVideoPlayer-ios.mm regression fix. (#20368)
[UIVideoViewWrapperIos clean] shouldn't reset _videoPlayer pointer, since it is called in setUrl method and leaves instance in invalid state. Subsequent calls to play, pause, etc. end up with crash.
1 parent 651acd0 commit 796e09f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cocos/ui/UIVideoPlayer-ios.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ -(id)init:(void*)videoPlayer
103103

104104
-(void) dealloc
105105
{
106+
_videoPlayer = nullptr;
106107
[self clean];
107108
[self.playerController release];
108109
[super dealloc];
109110
}
110111

111112
-(void) clean
112113
{
113-
_videoPlayer = nullptr;
114114
[self stop];
115115
[self removePlayerEventListener];
116116
[self.playerController.view removeFromSuperview];

0 commit comments

Comments
 (0)