diff options
author | qsr@chromium.org <qsr@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2012-12-17 14:20:13 +0000 |
---|---|---|
committer | qsr@chromium.org <qsr@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2012-12-17 14:20:13 +0000 |
commit | bdd7220794c02def4c8e100bd37f1978c8bbd001 (patch) | |
tree | fea534d3283be71acbd17bdf2aab5d34976e9409 /src/client/ios | |
parent | Remove dead code. (diff) | |
download | breakpad-bdd7220794c02def4c8e100bd37f1978c8bbd001.tar.xz |
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
Diffstat (limited to 'src/client/ios')
-rw-r--r-- | src/client/ios/BreakpadController.mm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/ios/BreakpadController.mm b/src/client/ios/BreakpadController.mm index bf31647d..ffba9e69 100644 --- a/src/client/ios/BreakpadController.mm +++ b/src/client/ios/BreakpadController.mm @@ -129,6 +129,9 @@ NSString* GetPlatform() { #pragma mark - - (void)start:(BOOL)onCurrentThread { + if (started) + return; + started_ = YES; void(^startBlock)() = ^{ assert(!breakpadRef_); breakpadRef_ = BreakpadCreate(configuration_); @@ -136,8 +139,6 @@ NSString* GetPlatform() { BreakpadAddUploadParameter(breakpadRef_, @"platform", GetPlatform()); } }; - NSAssert(!started_, @"Start cannot be called more than once."); - started_ = YES; if (onCurrentThread) startBlock(); else @@ -145,8 +146,8 @@ NSString* GetPlatform() { } - (void)stop { - NSAssert(started_, - @"The controller must be started before it can be stopped"); + if (!started) + return; started_ = NO; dispatch_sync(queue_, ^{ if (breakpadRef_) { |