We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a8a7a92 commit f7e0421Copy full SHA for f7e0421
cocos/ui/UIVideoPlayer-ios.mm
@@ -110,6 +110,7 @@ -(void) dealloc
110
111
-(void) clean
112
{
113
+ _videoPlayer = nullptr;
114
[self stop];
115
[self removePlayerEventListener];
116
[self.playerController.view removeFromSuperview];
@@ -243,7 +244,11 @@ -(void) stop
243
244
[self seekTo:0];
245
[self.playerController.player pause];
246
_state = PlayerbackStopped;
- _videoPlayer->onPlayEvent((int)VideoPlayer::EventType::STOPPED);
247
+
248
+ // stop() will be invoked in dealloc, which is invoked by _videoPlayer's destructor,
249
+ // so do't send the message when _videoPlayer is being deleted.
250
+ if (_videoPlayer)
251
+ _videoPlayer->onPlayEvent((int)VideoPlayer::EventType::STOPPED);
252
}
253
254
0 commit comments