mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2025-03-01 15:08:09 +00:00
Updating BreakpadController to allow start and stop being nop.
When BreakpadController is already started or stopped, trying to restart it or restopping it will now be no-op instead of asserting. Review URL: https://breakpad.appspot.com/505002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1092 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
6aab1f92bb
commit
bdd7220794
|
@ -129,6 +129,9 @@ NSString* GetPlatform() {
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
- (void)start:(BOOL)onCurrentThread {
|
- (void)start:(BOOL)onCurrentThread {
|
||||||
|
if (started)
|
||||||
|
return;
|
||||||
|
started_ = YES;
|
||||||
void(^startBlock)() = ^{
|
void(^startBlock)() = ^{
|
||||||
assert(!breakpadRef_);
|
assert(!breakpadRef_);
|
||||||
breakpadRef_ = BreakpadCreate(configuration_);
|
breakpadRef_ = BreakpadCreate(configuration_);
|
||||||
|
@ -136,8 +139,6 @@ NSString* GetPlatform() {
|
||||||
BreakpadAddUploadParameter(breakpadRef_, @"platform", GetPlatform());
|
BreakpadAddUploadParameter(breakpadRef_, @"platform", GetPlatform());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
NSAssert(!started_, @"Start cannot be called more than once.");
|
|
||||||
started_ = YES;
|
|
||||||
if (onCurrentThread)
|
if (onCurrentThread)
|
||||||
startBlock();
|
startBlock();
|
||||||
else
|
else
|
||||||
|
@ -145,8 +146,8 @@ NSString* GetPlatform() {
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)stop {
|
- (void)stop {
|
||||||
NSAssert(started_,
|
if (!started)
|
||||||
@"The controller must be started before it can be stopped");
|
return;
|
||||||
started_ = NO;
|
started_ = NO;
|
||||||
dispatch_sync(queue_, ^{
|
dispatch_sync(queue_, ^{
|
||||||
if (breakpadRef_) {
|
if (breakpadRef_) {
|
||||||
|
|
Loading…
Reference in a new issue