 +      finalize = ready_for_self_destruction_ && display_stream_wrappers_.empty();
 +    }
 +    if (finalize) {
-       delete this;
++      delete this;
 +    }
    }
  
-   void SaveStream(int unique_id,
-                   CGDisplayStreamRef stream) {
+   void SaveStream(int unique_id, CGDisplayStreamRef stream) {
 +    WriteLockScoped scoped_display_stream_manager_lock(*rw_lock_);
      RTC_CHECK(unique_id <= unique_id_generator_);
      DisplayStreamWrapper wrapper;
      wrapper.stream = stream;
-@@ -69,6 +82,7 @@ class DisplayStreamManager {
+@@ -47,6 +61,7 @@ class DisplayStreamManager {
    }
  
    void UnregisterActiveStreams() {

 
  private:
   struct DisplayStreamWrapper {
@@ -106,6 +128,7 @@ class DisplayStreamManager {
   std::map<int, DisplayStreamWrapper> display_stream_wrappers_;
   int unique_id_generator_ = 0;
   bool ready_for_self_destruction_ = false;
+  std::unique_ptr<RWLockWrapper> rw_lock_;
 };
 
 // Standard Mac displays have 72dpi, but we report 96dpi for
@@ -659,9 +682,6 @@ bool ScreenCapturerMac::RegisterRefreshAndMoveHandlers() {
             return;
           }
 
-          if (manager->ShouldIgnoreUpdates())
-            return;
-
           // Only pay attention to frame updates.
           if (status != kCGDisplayStreamFrameStatusFrameComplete)
             return;
@@ -672,7 +692,12 @@ bool ScreenCapturerMac::RegisterRefreshAndMoveHandlers() {
           if (count != 0) {
             // According to CGDisplayStream.h, it's safe to call
             // CGDisplayStreamStop() from within the callback.
-            ScreenRefresh(count, rects, display_origin);
+            manager->GetLock()->AcquireLockShared();
+            bool screen_capturer_mac_invalidated = manager->ShouldIgnoreUpdates();
+            if (!screen_capturer_mac_invalidated) {
+              ScreenRefresh(count, rects, display_origin);
+            }
+            manager->GetLock()->ReleaseLockShared();
           }
         };
 

diff --git a/modules/desktop_capture/mac/screen_capturer_mac.mm b/modules/desktop_capture/mac/screen_capturer_mac.mm
index df18777226..6a1e3da6ab 100644
--- a/modules/desktop_capture/mac/screen_capturer_mac.mm
+++ b/modules/desktop_capture/mac/screen_capturer_mac.mm
@@ -16,6 +16,7 @@
 #include "rtc_base/checks.h"
 #include "rtc_base/constructormagic.h"
 #include "rtc_base/logging.h"
+#include "rtc_base/synchronization/rw_lock_wrapper.h"
 #include "rtc_base/timeutils.h"
 #include "sdk/objc/Framework/Classes/Common/scoped_cftyperef.h"
 
@@ -28,18 +29,31 @@ namespace webrtc {
 // destroy itself once it's done.
 class DisplayStreamManager {
  public:
