From 2ad2b240c1ad3fe33c2de4f1783a39cd6fd96250 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Mon, 22 Jun 2020 13:48:32 +1000 Subject: [PATCH] Add debug assertions --- Signal/src/Loki/View Controllers/HomeVC.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Signal/src/Loki/View Controllers/HomeVC.swift b/Signal/src/Loki/View Controllers/HomeVC.swift index 4b205154e..46fcdbf36 100644 --- a/Signal/src/Loki/View Controllers/HomeVC.swift +++ b/Signal/src/Loki/View Controllers/HomeVC.swift @@ -198,6 +198,7 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, UIScrol } private func reload() { + AssertIsOnMainThread() uiDatabaseConnection.beginLongLivedReadTransaction() uiDatabaseConnection.read { transaction in self.threads.update(with: transaction) @@ -213,6 +214,7 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, UIScrol } @objc private func handleYapDatabaseModifiedNotification(_ notification: Notification) { + AssertIsOnMainThread() guard isObservingDatabase else { return } let notifications = uiDatabaseConnection.beginLongLivedReadTransaction() let ext = uiDatabaseConnection.ext(TSThreadDatabaseViewExtensionName) as! YapDatabaseViewConnection