fix: unsubscribe from observers when window is closing (#25554)

This commit is contained in:
Cheng Zhao 2020-09-23 10:53:32 +09:00 committed by GitHub
parent 29c6864ee1
commit 22c6c891be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 10 deletions

View file

@ -32,6 +32,11 @@ class NativeWindowMac : public NativeWindow, public ui::NativeThemeObserver {
NativeWindowMac(const gin_helper::Dictionary& options, NativeWindow* parent);
~NativeWindowMac() override;
// Cleanup observers when window is getting closed. Note that the destructor
// can be called much later after window gets closed, so we should not do
// cleanup in destructor.
void Cleanup();
// NativeWindow:
void SetContentView(views::View* view) override;
void Close() override;