Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Synchronise access to the library loader load method #58

Merged
merged 1 commit into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Mapbox welcomes participation and contributions from everyone. If you'd like to do so please see the [`Contributing Guide`](https://github.com/mapbox/mapbox-gl-native/blob/master/CONTRIBUTING.md) first to get started.

## Master
### Bugs
- Synchronise LibaryLoader#loadLibrary to avoid race conditions resulting in UnsatisfiedLinkError [#58](https://github.com/mapbox/mapbox-gl-native-android/pull/58)

## 8.6.0-alpha.1 - November 14, 2019
[Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v8.5.0...android-v8.6.0-alpha.1) since [Mapbox Maps SDK for Android v8.5.0](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v8.5.0):
### Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Loads the mapbox-gl shared library
* <p>
* By default uses the {@link System#loadLibrary(String)},
* By default uses SoLoader from https://github.com/facebook/SoLoader
* use {@link #setLibraryLoader(LibraryLoader)} to provide an alternative library loading hook.
* </p>
*/
Expand Down Expand Up @@ -36,7 +36,7 @@ public static void setLibraryLoader(LibraryLoader libraryLoader) {
* Catches UnsatisfiedLinkErrors and prints a warning to logcat.
* </p>
*/
public static void load() {
public static synchronized void load() {
try {
if (!loaded) {
loaded = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* Concrete implementation of a native library loader.
* <p>
* Uses ReLinker from https://github.com/KeepSafe/ReLinker.
* Uses SoLoader from https://github.com/facebook/SoLoader.
* </p>
*/
public class LibraryLoaderProviderImpl implements LibraryLoaderProvider {
Expand All @@ -28,7 +28,7 @@ public LibraryLoader getDefaultLibraryLoader() {
}

/**
* Concrete implementation of a LibraryLoader using ReLinker.
* Concrete implementation of a LibraryLoader using SoLoader.
*/
private static class SoLibraryLoader extends LibraryLoader {

Expand All @@ -43,6 +43,7 @@ public void load(String name) {
} catch (MapboxConfigurationException exception) {
Logger.e(TAG, "Couldn't load so file with relinker, application context missing, "
+ "call Mapbox.getInstance(Context context, String accessToken) first");
throw new UnsatisfiedLinkError(exception.getMessage());
}
}
}
Expand Down