wxWidgets 中 wxIPV4address addr; 引发异常的原因

很多问题,一定是要放在特定环境才能出现的。比如,有如下代码

void * QueryInfoSocketThread::Entry()
{
	wxIPV4address addr; 
	if(!addr.Service(ListenPort)) 
		return NULL; 

	wxSocketServer* pServerSocket = new wxSocketServer(addr); 

wxIPV4address addr; 这句代码竟然可以引发异常!不可思议哦!

引发的异常如下图:


这真的是很奇怪,很快发现问题不是我一个:

http://trac.wxwidgets.org/ticket/3010

那个人n年前就举报了........(⊙_⊙)

后来维护人员忍不住了!

After reading the whole discussion I don't understand what needs to be done here. AFAICS the only problem is that Initialize() must be called from the main thread but it doesn't seem to be a big limitation, is it?

你们不知道在主线程开始前要 Initialize 吗~~~~~~

猪啊啊啊啊啊啊啊~~~~~

于是:

QueryInfoServer::QueryInfoServer()
{
	wxSocketBase::Initialize();
	_pQuerySocketThread = new QueryInfoSocketThread( );
	SetListenPort(1111);
}

解决了~~~~

真是弱智问题嗷嗷

posted on   norsd  阅读(219)  评论(0编辑  收藏  举报

编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 葡萄城 AI 搜索升级:DeepSeek 加持,客户体验更智能
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏

导航

< 2011年11月 >
30 31 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 1 2 3
4 5 6 7 8 9 10
点击右上角即可分享
微信分享提示