Initialize last_cursor_

This ensures that last_cursor_ is intialized before it is checked.
This code is in the Firefox repo with the original review here:
https://phabricator.services.mozilla.com/D113833

Bug: webrtc:13481
Change-Id: I806009cba1aba193ab12bb86e39f98c56043000f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239725
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35509}
This commit is contained in:
Nico Grunbaum 2021-12-08 12:46:52 -08:00 committed by WebRTC LUCI CQ
parent 539f3e1a89
commit a6b138d6b4

View file

@ -75,9 +75,9 @@ class MouseCursorMonitorMac : public MouseCursorMonitor {
rtc::scoped_refptr<DesktopConfigurationMonitor> configuration_monitor_;
CGWindowID window_id_;
ScreenId screen_id_;
Callback* callback_;
Callback* callback_ = NULL;
Mode mode_;
__strong NSImage* last_cursor_;
__strong NSImage* last_cursor_ = NULL;
};
MouseCursorMonitorMac::MouseCursorMonitorMac(const DesktopCaptureOptions& options,
@ -86,7 +86,6 @@ MouseCursorMonitorMac::MouseCursorMonitorMac(const DesktopCaptureOptions& option
: configuration_monitor_(options.configuration_monitor()),
window_id_(window_id),
screen_id_(screen_id),
callback_(NULL),
mode_(SHAPE_AND_POSITION) {
RTC_DCHECK(window_id == kCGNullWindowID || screen_id == kInvalidScreenId);
}