QAbstractSocket::abort() with SIGSEGV
I met quite confusing situation:
I place brand new QTcpSocket and QUdpSocket on heap in main widget constructor.
I used UDP socket (it worked fine) and then I added TCP socket. It does nothing.
And now when the method shown below is executed I receive SIGSEGV:
udpSocket->abort();
tcpSocket->abort();
gdb says:
Quote:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1225090688 (LWP 6134)]
QAbstractSocket::abort (this=0x0) at qabstractsocket.h:184
184 qabstractsocket.h: No such file or directory.
in qabstractsocket.h
Current language: auto; currently c++
but when I change it to:
udpSocket->abort();
tcpSocket->disconnectFromHost();
everything goes well.
What's the matter?
Re: QAbstractSocket::abort() with SIGSEGV
Either tcpSocket or udpSocket is a null pointer (notice that "this" is null). You probably have a local variable of the same name as a member variable of the class.