fix: ensure external memory adjustments are balanced (#33266)
This commit is contained in:
parent
cf3ee7be56
commit
652680e801
2 changed files with 13 additions and 7 deletions
|
@ -121,7 +121,7 @@ class NativeImage : public gin::Wrappable<NativeImage> {
|
|||
float GetAspectRatio(const absl::optional<float> scale_factor);
|
||||
void AddRepresentation(const gin_helper::Dictionary& options);
|
||||
|
||||
void AdjustAmountOfExternalAllocatedMemory(bool add);
|
||||
void UpdateExternalAllocatedMemoryUsage();
|
||||
|
||||
// Mark the image as template image.
|
||||
void SetTemplateImage(bool setAsTemplate);
|
||||
|
@ -136,6 +136,7 @@ class NativeImage : public gin::Wrappable<NativeImage> {
|
|||
gfx::Image image_;
|
||||
|
||||
v8::Isolate* isolate_;
|
||||
int32_t memory_usage_ = 0;
|
||||
};
|
||||
|
||||
} // namespace api
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue