mirror of
https://github.com/itay-grudev/SingleApplication.git
synced 2025-01-15 17:02:06 +08:00
Bug fix possible situation in which memory is detached
This commit is contained in:
parent
c5ea3f6d30
commit
fc5ce4c335
@ -121,14 +121,11 @@ SingleApplication::SingleApplication(int &argc, char *argv[])
|
|||||||
// might have crashed.
|
// might have crashed.
|
||||||
// So only after a successful connection is the second instance
|
// So only after a successful connection is the second instance
|
||||||
// terminated.
|
// terminated.
|
||||||
if( d->socket->waitForConnected(100) )
|
d->socket->waitForConnected(100);
|
||||||
{
|
delete d->memory;
|
||||||
|
|
||||||
// Terminate the program using STDLib's exit function
|
// Terminate the program using STDLib's exit function
|
||||||
::exit(EXIT_SUCCESS);
|
::exit(EXIT_SUCCESS);
|
||||||
} else {
|
|
||||||
delete d->memory;
|
|
||||||
::exit(EXIT_SUCCESS);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user