Quantcast
Channel: Installation and Deployment
Viewing all articles
Browse latest Browse all 22112

Is deleteLater() processed BEFORE other events posted by the object?

$
0
0
Well the title says it all, but for a real world example, suppose I initialize a QTcpSocket. When I am done with it, I want to delete it with code like this: void terminateSocket() {     socket->deleteLater();     ...     some_long_operation(); } In the rare (?) situation where a packet arrives when some_long_operation() is running, after the function finishes which event is processed sooner? Is it: 1. the socket is deleted and all its events and pending signals are discarded, or 2. first events are processed and signals emitted then the socket object is deleted? or is it something different? Another example can be a timer. Suppose the slot connected to its timeout() signal realizes that timer’s job is done so it stops the timer and calls deleteLater() on it. What happens if another timeout() signal is emitted before the mentioned slot is finished executing? Is the timer deleted and the signal discarded, or does it call the slot again? (What if the signal-slot connection is not direct connection?) Sorry if the question is broad.

Viewing all articles
Browse latest Browse all 22112

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>