diff --git a/engine/src/flutter/runtime/dart_init.cc b/engine/src/flutter/runtime/dart_init.cc index 2b5a80b370..642555b0d3 100644 --- a/engine/src/flutter/runtime/dart_init.cc +++ b/engine/src/flutter/runtime/dart_init.cc @@ -299,7 +299,7 @@ Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri, static bool GetAssetAsBuffer( const std::string& name, std::vector* data, - std::unique_ptr& directory_asset_bundle, + fxl::RefPtr& directory_asset_bundle, fxl::RefPtr& asset_store) { return (directory_asset_bundle && directory_asset_bundle->GetAsBuffer(name, data)) || @@ -340,7 +340,7 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri, struct stat stat_result = {}; if (::stat(bundle_path.c_str(), &stat_result) == 0) { - std::unique_ptr directory_asset_bundle; + fxl::RefPtr directory_asset_bundle; // TODO(zarah): Remove usage of zip_asset_store once app.flx is removed. fxl::RefPtr zip_asset_store; // bundle_path is either the path to app.flx or the flutter assets @@ -348,7 +348,7 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri, std::string flx_path = bundle_path; if (S_ISDIR(stat_result.st_mode)) { directory_asset_bundle = - std::make_unique(bundle_path); + fxl::MakeRefCounted(bundle_path); flx_path = files::GetDirectoryName(bundle_path) + "/app.flx"; }