From cc3542dc4428b56e3356cd36b2d2516872859b77 Mon Sep 17 00:00:00 2001
From: "ivan.penkov@gmail.com"
 <ivan.penkov@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>
Date: Wed, 19 Mar 2014 18:58:36 +0000
Subject: Fix a bug in BreakpadController that prevented multiple report
 uploads per call to sendStoredCrashReports.

Submitting this patch on behalf of Asher Segel-Brown.

R=blundell@chromium.org, mark@chromium.org, qsr@chromium.org

Review URL: https://breakpad.appspot.com/1234002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1288 4c0a9323-5329-0410-9bdc-e9ce6186880e
---
 src/client/ios/BreakpadController.mm | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

(limited to 'src')

diff --git a/src/client/ios/BreakpadController.mm b/src/client/ios/BreakpadController.mm
index 94d93d60..a85dd68e 100644
--- a/src/client/ios/BreakpadController.mm
+++ b/src/client/ios/BreakpadController.mm
@@ -309,10 +309,14 @@ NSString* GetPlatform() {
       }
 
       // A report must be sent later.
-      if (timeToWait > 0)
-        [self performSelector:@selector(sendStoredCrashReports)
-                   withObject:nil
-                   afterDelay:timeToWait];
+      if (timeToWait > 0) {
+        // performSelector: doesn't work on queue_
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [self performSelector:@selector(sendStoredCrashReports)
+                       withObject:nil
+                       afterDelay:timeToWait];
+        });
+     }
   });
 }
 
-- 
cgit v1.2.1