Revert "Hold a global reference to the AssetManager Java object backing the APKAssetProvider (#5078)" (#5116)

This reverts commit ac682632d7b050463e0461cbb416aaedbcba4bcf.

It causes engine crashes in some Android Espresso tests.
This commit is contained in:
Yegor 2018-04-27 13:47:26 -07:00 committed by GitHub
parent b28a35dde3
commit cf026b098d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View File

@ -10,8 +10,7 @@ namespace blink {
APKAssetProvider::APKAssetProvider(JNIEnv* env,
jobject jassetManager,
std::string directory)
: java_asset_manager_(env, jassetManager),
directory_(std::move(directory)) {
: directory_(std::move(directory)) {
assetManager_ = AAssetManager_fromJava(env, jassetManager);
}

View File

@ -9,7 +9,6 @@
#include <jni.h>
#include "flutter/assets/asset_resolver.h"
#include "flutter/fml/platform/android/scoped_java_ref.h"
#include "lib/fxl/memory/ref_counted.h"
namespace blink {
@ -22,7 +21,6 @@ class APKAssetProvider final : public AssetResolver {
virtual ~APKAssetProvider();
private:
fml::jni::ScopedJavaGlobalRef<jobject> java_asset_manager_;
AAssetManager* assetManager_;
const std::string directory_;
@ -38,4 +36,4 @@ class APKAssetProvider final : public AssetResolver {
} // namespace blink
#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H
#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H