[Impeller] Fix calling release() in OpenFixtureAsSkData relying on execution order of arguments. (flutter/engine#34369)
This commit is contained in:
@@ -395,12 +395,14 @@ static sk_sp<SkData> OpenFixtureAsSkData(const char* fixture_name) {
|
||||
if (!mapping) {
|
||||
return nullptr;
|
||||
}
|
||||
return SkData::MakeWithProc(
|
||||
auto data = SkData::MakeWithProc(
|
||||
mapping->GetMapping(), mapping->GetSize(),
|
||||
[](const void* ptr, void* context) {
|
||||
delete reinterpret_cast<fml::Mapping*>(context);
|
||||
},
|
||||
mapping.release());
|
||||
mapping.get());
|
||||
mapping.release();
|
||||
return data;
|
||||
}
|
||||
|
||||
bool RenderTextInCanvas(std::shared_ptr<Context> context,
|
||||
|
||||
@@ -52,12 +52,14 @@ static sk_sp<SkData> OpenFixtureAsSkData(const char* fixture_name) {
|
||||
if (!mapping) {
|
||||
return nullptr;
|
||||
}
|
||||
return SkData::MakeWithProc(
|
||||
auto data = SkData::MakeWithProc(
|
||||
mapping->GetMapping(), mapping->GetSize(),
|
||||
[](const void* ptr, void* context) {
|
||||
delete reinterpret_cast<fml::Mapping*>(context);
|
||||
},
|
||||
mapping.release());
|
||||
mapping.get());
|
||||
mapping.release();
|
||||
return data;
|
||||
}
|
||||
|
||||
SkFont DisplayListPlayground::CreateTestFontOfSize(SkScalar scalar) {
|
||||
|
||||
Reference in New Issue
Block a user