mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: don't invoke callback after FrameSubscriber is destroyed (#13657)
This commit is contained in:
committed by
Samuel Attard
parent
ffc15e02a6
commit
77ca5b7d64
@@ -26,7 +26,8 @@ FrameSubscriber::FrameSubscriber(v8::Isolate* isolate,
|
||||
: content::WebContentsObserver(web_contents),
|
||||
isolate_(isolate),
|
||||
callback_(callback),
|
||||
only_dirty_(only_dirty) {}
|
||||
only_dirty_(only_dirty),
|
||||
weak_ptr_factory_(this) {}
|
||||
|
||||
FrameSubscriber::~FrameSubscriber() = default;
|
||||
|
||||
@@ -64,7 +65,7 @@ void FrameSubscriber::DidReceiveCompositorFrame() {
|
||||
|
||||
view->CopyFromSurface(
|
||||
gfx::Rect(), view->GetViewBounds().size(),
|
||||
base::BindOnce(&FrameSubscriber::Done, base::Unretained(this),
|
||||
base::BindOnce(&FrameSubscriber::Done, weak_ptr_factory_.GetWeakPtr(),
|
||||
GetDamageRect()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user