Skip to content

Commit

Permalink
Revert "Hold a global reference to the AssetManager Java object backi…
Browse files Browse the repository at this point in the history
…ng the APKAssetProvider (flutter#5078)" (flutter#5116)

This reverts commit ac68263.

It causes engine crashes in some Android Espresso tests.
  • Loading branch information
yjbanov authored Apr 27, 2018
1 parent b28a35d commit cf026b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions shell/platform/android/apk_asset_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 1 addition & 3 deletions shell/platform/android/apk_asset_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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_;

Expand All @@ -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

0 comments on commit cf026b0

Please sign in to comment.