File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ bool VideoPlayerTest::init()
4343
4444 _visibleRect = Director::getInstance ()->getOpenGLView ()->getVisibleRect ();
4545
46+ // Should create video first to make sure video is destryed first. If not, then may crash.
47+ // Because when destroying video, it will stop video which may trigger stopped event listener.
48+ createVideo ();
49+
4650 MenuItemFont::setFontSize (16 );
4751
4852 auto fullSwitch = MenuItemFont::create (" FullScreenSwitch" , CC_CALLBACK_1 (VideoPlayerTest::menuFullScreenCallback, this ));
@@ -95,8 +99,6 @@ bool VideoPlayerTest::init()
9599 _loopStatusLabel->setAnchorPoint (Vec2::ANCHOR_MIDDLE_RIGHT);
96100 _loopStatusLabel->setPosition (Vec2 (_visibleRect.origin .x + _visibleRect.size .width - 10 ,_visibleRect.origin .y + 185 ));
97101 _uiLayer->addChild (_loopStatusLabel);
98-
99- createVideo ();
100102
101103 return true ;
102104}
You can’t perform that action at this time.
0 commit comments