Does closing a QProcess detach it from QSharedMemory it was attached to?
Solved
General and Desktop
-
- I create a
QSharedMemory
instance in the main application. - I then create and start a
QProcess
and wait for it to finish (or time out) in the main application thread - The created process attaches to the
QSharedMemory
instance and starts doing some computation
The process then updates the main application on its progress via
readyRead()
. A progress dialog is being displayed to the user and if they press Cancel, then the process is closed usingsubProcess->close()
.My question is: Since the child process is killed, is it automatically detached from the
QSharedMemory
it attached to? Or since it did not detach properly (viaQSharedMemory
's destructor for example) would there be a memory leak?Thanks.
- I create a
-
The documentation is imo very clear about this: http://doc.qt.io/qt-5/qsharedmemory.html#details