Remove itself from the cleanup list when it is destroyed
This commit is contained in:
parent
1e7c8c9fda
commit
eb8426269f
4 changed files with 24 additions and 10 deletions
|
@ -48,7 +48,7 @@ class TrackableObjectBase : public mate::EventEmitter {
|
|||
|
||||
// Register a callback that should be destroyed before JavaScript environment
|
||||
// gets destroyed.
|
||||
static void RegisterDestructionCallback(const base::Closure& closure);
|
||||
static base::Closure RegisterDestructionCallback(const base::Closure& c);
|
||||
|
||||
int32_t weak_map_id_;
|
||||
base::SupportsUserData* wrapped_;
|
||||
|
@ -56,6 +56,7 @@ class TrackableObjectBase : public mate::EventEmitter {
|
|||
private:
|
||||
void Destroy();
|
||||
|
||||
base::Closure cleanup_;
|
||||
base::WeakPtrFactory<TrackableObjectBase> weak_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TrackableObjectBase);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue