mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-19 20:48:09 +00:00
fix(src/externals/single-application/SingleApplication): coding style
This commit is contained in:
parent
32e737fcf1
commit
b165cfeaa2
1 changed files with 24 additions and 21 deletions
|
|
@ -389,32 +389,35 @@ SingleApplication::SingleApplication (int &argc, char *argv[], bool allowSeconda
|
|||
if (d->memory->create(sizeof(InstancesInfo))) {
|
||||
d->startPrimary(true);
|
||||
return;
|
||||
} else {
|
||||
// Attempt to attach to the memory segment
|
||||
if (d->memory->attach()) {
|
||||
d->memory->lock();
|
||||
InstancesInfo *inst = static_cast<InstancesInfo *>(d->memory->data());
|
||||
}
|
||||
|
||||
if (!inst->primary) {
|
||||
d->startPrimary(false);
|
||||
d->memory->unlock();
|
||||
return;
|
||||
}
|
||||
// Attempt to attach to the memory segment
|
||||
if (d->memory->attach()) {
|
||||
d->memory->lock();
|
||||
|
||||
// Check if another instance can be started
|
||||
if (allowSecondary) {
|
||||
inst->secondary += 1;
|
||||
d->instanceNumber = inst->secondary;
|
||||
d->startSecondary();
|
||||
if (d->options & Mode::SecondaryNotification) {
|
||||
d->connectToPrimary(timeout, SecondaryInstance);
|
||||
}
|
||||
d->memory->unlock();
|
||||
return;
|
||||
}
|
||||
InstancesInfo *inst = static_cast<InstancesInfo *>(d->memory->data());
|
||||
|
||||
if (!inst->primary) {
|
||||
d->startPrimary(false);
|
||||
d->memory->unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if another instance can be started
|
||||
if (allowSecondary) {
|
||||
inst->secondary += 1;
|
||||
d->instanceNumber = inst->secondary;
|
||||
|
||||
d->startSecondary();
|
||||
if (d->options & Mode::SecondaryNotification)
|
||||
d->connectToPrimary(timeout, SecondaryInstance);
|
||||
|
||||
d->memory->unlock();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
d->memory->unlock();
|
||||
}
|
||||
|
||||
d->connectToPrimary(timeout, NewInstance);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue