Fix a crash when exiting an application on Android and iOS

This commit is contained in:
Emeric 2020-04-20 18:33:30 +02:00
parent 4baf2e74f6
commit b4a1f19d81

View File

@ -69,19 +69,21 @@ SingleApplicationPrivate::~SingleApplicationPrivate()
delete socket;
}
memory->lock();
InstancesInfo* inst = static_cast<InstancesInfo*>(memory->data());
if( server != nullptr ) {
server->close();
delete server;
inst->primary = false;
inst->primaryPid = -1;
inst->primaryUser[0] = '\0';
inst->checksum = blockChecksum();
}
memory->unlock();
if( memory != nullptr ) {
memory->lock();
InstancesInfo* inst = static_cast<InstancesInfo*>(memory->data());
if( server != nullptr ) {
server->close();
delete server;
inst->primary = false;
inst->primaryPid = -1;
inst->primaryUser[0] = '\0';
inst->checksum = blockChecksum();
}
memory->unlock();
delete memory;
delete memory;
}
}
QString SingleApplicationPrivate::getUsername()