diff --git a/engine/src/flutter/impeller/typographer/rectangle_packer.cc b/engine/src/flutter/impeller/typographer/rectangle_packer.cc index b80faa7d4e..bebecf69ae 100644 --- a/engine/src/flutter/impeller/typographer/rectangle_packer.cc +++ b/engine/src/flutter/impeller/typographer/rectangle_packer.cc @@ -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::Factory(int width, + int height) { + return std::make_unique(width, height); } } // namespace impeller diff --git a/engine/src/flutter/impeller/typographer/rectangle_packer.h b/engine/src/flutter/impeller/typographer/rectangle_packer.h index 9213cae678..48365a515f 100644 --- a/engine/src/flutter/impeller/typographer/rectangle_packer.h +++ b/engine/src/flutter/impeller/typographer/rectangle_packer.h @@ -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 Factory(int width, int height); virtual ~RectanglePacker() {}