Revert #3035 which was causing memory growth issue (#3315)

This commit is contained in:
Bart Louwers
2025-03-17 19:00:07 +01:00
committed by GitHub
parent 296ce07394
commit 00956faefb
80 changed files with 294 additions and 348 deletions

View File

@@ -30,13 +30,13 @@ FileSource::FileSource(jni::JNIEnv& _env,
mbgl::FileSourceManager::get()->registerFileSourceFactory(
mbgl::FileSourceType::Asset,
[](const mbgl::ResourceOptions& resourceOptions_, const mbgl::ClientOptions& clientOptions_) {
[](const mbgl::ResourceOptions& resourceOptions, const mbgl::ClientOptions& clientOptions) {
auto env{android::AttachEnv()};
std::unique_ptr<mbgl::FileSource> assetFileSource;
if (android::MapLibre::hasInstance(*env)) {
auto assetManager = android::MapLibre::getAssetManager(*env);
assetFileSource = std::make_unique<AssetManagerFileSource>(
*env, assetManager, resourceOptions_.clone(), clientOptions_.clone());
*env, assetManager, resourceOptions.clone(), clientOptions.clone());
}
return assetFileSource;
});
@@ -161,7 +161,7 @@ void FileSource::setResourceCachePath(jni::JNIEnv& env,
pathChangeCallback = {};
});
databaseSource->setDatabasePath(newPath + DATABASE_FILE, std::move(pathChangeCallback));
databaseSource->setDatabasePath(newPath + DATABASE_FILE, pathChangeCallback);
}
void FileSource::resume(jni::JNIEnv&) {