Index: media/video/capture/mac/video_capture_device_mac.h |
diff --git a/media/video/capture/mac/video_capture_device_mac.h b/media/video/capture/mac/video_capture_device_mac.h |
index b672409b8c36b5f6307f181a30f8b3946e9496b5..7b1070a5ae571b3ea9cc296f592abb01bdbfff92 100644 |
--- a/media/video/capture/mac/video_capture_device_mac.h |
+++ b/media/video/capture/mac/video_capture_device_mac.h |
@@ -72,13 +72,13 @@ class VideoCaptureDeviceMac : public VideoCaptureDevice { |
const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
InternalState state_; |
- // Used with Bind and PostTask to ensure that methods aren't called |
- // after the VideoCaptureDeviceMac is destroyed. |
- base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_; |
- base::WeakPtr<VideoCaptureDeviceMac> weak_this_; |
- |
id<PlatformVideoCapturingMac> capture_device_; |
+ // Used with Bind and PostTask to ensure that methods aren't called after the |
+ // VideoCaptureDeviceMac is destroyed. NOTE: This must always be last so it's |
+ // invalidated before other member variables might be accessed. |
+ base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_; |
+ |
DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac); |
}; |