Problem: TestCpp Crashed
- version of cocos: cocos2d-x-3.0beta2
- Environment:(win32) Windows 7
Dev Tools:Microsoft Visual Studio Express 2012 for Windows Desktop
(Version 11.0.61030.00 Update 4)
3)Steps: Run in Debugger mode,
close program with the blue circle mark.
- details of the error:
Crashed when closed
Please see attached files and 4 screen dumps for details.
Call_Stack.txt.zip (0.6 KB)
screen001.jpg (383.5 KB)
screen002.jpg (366.0 KB)
screen003.jpg (144.3 KB)
screen004.jpg (460.8 KB)
Output.txt.zip (1.6 KB)
Chano
#2
I have the same environment as you and I have the same problem.
However, if I comment out Console::listenOnTCP(int port), the problem disappears.
This method is also the cause that cocos2d-x-3.0 doesn’t work on Windows XP, so there’s something fishy with it
Thank you Chano Marrano!!
It works.
I comment out those lines:
C:\cocos2d-x-3.0beta2\samples\Cpp\TestCpp\Classes\ConsoleTest\ConsoleTest.cpp
146 // _console->listenOnTCP(5678);
C:\cocos2d-x-3.0beta2\samples\Cpp\TestCpp\Classes\ConsoleTest\ConsoleTest.cpp
188 //_console->listenOnTCP(5678);
C:\cocos2d-x-3.0beta2\samples\Cpp\TestCpp\Classes\AppDelegate.cpp
87 // console->listenOnTCP(5678);
Chano
#4
You’re welcome!
By the way, I don’t know if Console::listenOnTCP worked with the first beta of cocos2d-x 3.0, but at least the app didn’t crash when it was closed.
hello,这个情况应该属于电脑的端口被占用
like this in cmd:
C:\Users\川>netstat -aon|findstr “5678”
TCP 0.0.0.0:5678 0.0.0.0:0 LISTENING 7392
UDP 0.0.0.0:5678 : 7392
C:\Users\川>tasklist|findstr “7392”
ThunderPlatform.exe 7392 Console 1 58,224 K
可以看出这个是 被ThunderPlatform.exe 这个程序占用了端口,导致testCpp运行失败!
希望这个对你有帮助。
zfree
#6
问题应该是CCConsole.cpp的Console::loop函数
void Console::loop()
{
…
for(const auto &fd: _fds )
close(fd); //在windows上应该使用closesocket关闭socket。
close(_listenfd); //在windows上应该使用closesocket关闭socket。
_running = false;
}