GRDBDemoiOS: stress fetched records controller longer, so that we can check what happens when one leaves the table view controller as transactions are still running. Answer: we crash due to [unowned self] references being used after table view controller has been deallocated.

This commit is contained in:
Gwendal Roué committed 2016-06-04 18:22:18 +02:00
1 parent 770ee6aaec
commit a8f04a1ba5
1 file changed
+2 -3
@@ -3,7 +3,7 @@ import GRDB
class PersonsViewController: UITableViewController {
var personsController: FetchedRecordsController<Person>!
override func viewDidLoad() {
super.viewDidLoad()
@@ -187,8 +187,7 @@ extension PersonsViewController {
@IBAction func stressTest() {
setEditing(false, animated: true)
// Spawn some concurrent background jobs
for _ in 0..<20 {
for _ in 0..<1000 {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
try! dbQueue.inTransaction { db in
if Person.fetchCount(db) == 0 {