ipc: use deleteLater() in IpcServerConnection to prevent use-after-free
This commit is contained in:
parent
8fd0de4580
commit
191085a882
1 changed files with 2 additions and 2 deletions
|
|
@ -61,7 +61,7 @@ IpcServerConnection::IpcServerConnection(QLocalSocket* socket, IpcServer* server
|
|||
|
||||
void IpcServerConnection::onDisconnected() {
|
||||
qCInfo(logIpc) << "IPC connection disconnected" << this;
|
||||
delete this;
|
||||
this->deleteLater();
|
||||
}
|
||||
|
||||
void IpcServerConnection::onReadyRead() {
|
||||
|
|
@ -88,7 +88,7 @@ void IpcServerConnection::onReadyRead() {
|
|||
|
||||
// async connections reparent
|
||||
if (dynamic_cast<IpcServer*>(this->parent()) != nullptr) {
|
||||
delete this;
|
||||
this->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue