这两句会在我删除我的对象的时候出现
udpChat
= new UdpServer();
threadUdp
= new QThread(this);
udpChat
->moveToThread(threadUdp
);
threadUdp
->start();
delete udpChat
;
QObject::killTimer: Timers cannot be stopped from another thread QObject::~QObject: Timers cannot be stopped from another thread
添加这两个槽后 即可
connect( threadUdp
, SIGNAL(finished()), udpChat
, SLOT(deleteLater()) );
connect( threadUdp
, SIGNAL(finished()), threadUdp
, SLOT(deleteLater()) );
参考来源:https://www.cnblogs.com/liushui-sky/p/5976979.html