Commit b165cfea authored by Ronan Abhamon's avatar Ronan Abhamon

fix(src/externals/single-application/SingleApplication): coding style

parent 32e737fc
...@@ -389,10 +389,12 @@ SingleApplication::SingleApplication (int &argc, char *argv[], bool allowSeconda ...@@ -389,10 +389,12 @@ SingleApplication::SingleApplication (int &argc, char *argv[], bool allowSeconda
if (d->memory->create(sizeof(InstancesInfo))) { if (d->memory->create(sizeof(InstancesInfo))) {
d->startPrimary(true); d->startPrimary(true);
return; return;
} else { }
// Attempt to attach to the memory segment // Attempt to attach to the memory segment
if (d->memory->attach()) { if (d->memory->attach()) {
d->memory->lock(); d->memory->lock();
InstancesInfo *inst = static_cast<InstancesInfo *>(d->memory->data()); InstancesInfo *inst = static_cast<InstancesInfo *>(d->memory->data());
if (!inst->primary) { if (!inst->primary) {
...@@ -405,17 +407,18 @@ SingleApplication::SingleApplication (int &argc, char *argv[], bool allowSeconda ...@@ -405,17 +407,18 @@ SingleApplication::SingleApplication (int &argc, char *argv[], bool allowSeconda
if (allowSecondary) { if (allowSecondary) {
inst->secondary += 1; inst->secondary += 1;
d->instanceNumber = inst->secondary; d->instanceNumber = inst->secondary;
d->startSecondary(); d->startSecondary();
if (d->options & Mode::SecondaryNotification) { if (d->options & Mode::SecondaryNotification)
d->connectToPrimary(timeout, SecondaryInstance); d->connectToPrimary(timeout, SecondaryInstance);
}
d->memory->unlock(); d->memory->unlock();
return; return;
} }
d->memory->unlock(); d->memory->unlock();
} }
}
d->connectToPrimary(timeout, NewInstance); d->connectToPrimary(timeout, NewInstance);
delete d; delete d;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment