Closing a qmainwindow application on Windows
-
Hi All,
I am developing a network qt application (client-server application). In fact, I 'm using QTcpSocket to communicate between the clients and the server.
The application works well, but when i try to close the client interface on Windows, I have a runtime problem. Exactly, I have this problem: his application has requested the runtime to terminate it in an unusual way.
I tried to re-implement the closeEvent function by closing the client socket on closing the main window, but i still have the same problem.
How can i fix this bug?
Any help would be appreciated. -
Hi All,
I am developing a network qt application (client-server application). In fact, I 'm using QTcpSocket to communicate between the clients and the server.
The application works well, but when i try to close the client interface on Windows, I have a runtime problem. Exactly, I have this problem: his application has requested the runtime to terminate it in an unusual way.
I tried to re-implement the closeEvent function by closing the client socket on closing the main window, but i still have the same problem.
How can i fix this bug?
Any help would be appreciated. -
Why do you think this is related to your network programming? Could be anything.
-
90% of such problems occur when people provide parent to the QObject (usually QWidget ) derived classes allocated on the heap.
As result their objects are deleted twice which causes termination. -
Why do you think this is related to your network programming? Could be anything.
@Wieland
I tried to execute my application without communication between the client and the server. And by doing that, i haven't any problem on closing the application.
I think that the cause of this problem that the runtime still receives responses to the clients, that's why, it couldn't close properly this application.
Have you any idea how to fix this problem?