From bdd7220794c02def4c8e100bd37f1978c8bbd001 Mon Sep 17 00:00:00 2001 From: "qsr@chromium.org" Date: Mon, 17 Dec 2012 14:20:13 +0000 Subject: 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 --- src/client/ios/BreakpadController.mm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/client/ios') 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_) { -- cgit v1.2.1