Do not access members after calling ClearDartWrapper (flutter/engine#20465)

This commit is contained in:
Jason Simmons 2020-08-13 11:06:02 -07:00 committed by GitHub
parent 90ec5ff7d2
commit a67e03a61c
3 changed files with 3 additions and 3 deletions

View File

@ -486,10 +486,10 @@ void Canvas::drawShadow(const CanvasPath* path,
}
void Canvas::Invalidate() {
canvas_ = nullptr;
if (dart_wrapper()) {
ClearDartWrapper();
}
canvas_ = nullptr;
}
} // namespace flutter

View File

@ -37,8 +37,8 @@ Dart_Handle CanvasImage::toByteData(int format, Dart_Handle callback) {
}
void CanvasImage::dispose() {
ClearDartWrapper();
image_.reset();
ClearDartWrapper();
}
size_t CanvasImage::GetAllocationSize() const {

View File

@ -56,8 +56,8 @@ Dart_Handle Picture::toImage(uint32_t width,
}
void Picture::dispose() {
ClearDartWrapper();
picture_.reset();
ClearDartWrapper();
}
size_t Picture::GetAllocationSize() const {