fix: memory leak in BrowserWindow (#27621)

This commit is contained in:
Jeremy Rose 2021-02-05 13:20:20 -08:00 committed by GitHub
parent b6a91ef5df
commit e87803919b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 33 deletions

View file

@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/memory/weak_ptr.h"
#include "shell/common/gin_helper/cleaned_up_at_exit.h"
#include "shell/common/gin_helper/event_emitter.h"
#include "shell/common/key_weak_map.h"
@ -19,7 +20,7 @@ class SupportsUserData;
namespace gin_helper {
// Users should use TrackableObject instead.
class TrackableObjectBase {
class TrackableObjectBase : public CleanedUpAtExit {
public:
TrackableObjectBase();
@ -33,7 +34,7 @@ class TrackableObjectBase {
static int32_t GetIDFromWrappedClass(base::SupportsUserData* wrapped);
protected:
virtual ~TrackableObjectBase();
~TrackableObjectBase() override;
// Returns a closure that can destroy the native class.
base::OnceClosure GetDestroyClosure();