[Impeller] Fix leak of rectangle packer in typographer tests (flutter/engine#51113)
This commit is contained in:
@@ -166,8 +166,9 @@ void SkylineRectanglePacker::addSkylineLevel(int skylineIndex,
|
||||
}
|
||||
}
|
||||
|
||||
RectanglePacker* RectanglePacker::Factory(int width, int height) {
|
||||
return new SkylineRectanglePacker(width, height);
|
||||
std::unique_ptr<RectanglePacker> RectanglePacker::Factory(int width,
|
||||
int height) {
|
||||
return std::make_unique<SkylineRectanglePacker>(width, height);
|
||||
}
|
||||
|
||||
} // namespace impeller
|
||||
|
||||
@@ -27,7 +27,7 @@ class RectanglePacker {
|
||||
//----------------------------------------------------------------------------
|
||||
/// @brief Return an empty packer with area specified by width and height.
|
||||
///
|
||||
static RectanglePacker* Factory(int width, int height);
|
||||
static std::unique_ptr<RectanglePacker> Factory(int width, int height);
|
||||
|
||||
virtual ~RectanglePacker() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user