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

Commit

Permalink
[libaryloader] synchronise access to the library loader load method (#58
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tobrun authored Nov 18, 2019
1 parent 6cebb51 commit 8b20a92
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
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

0 comments on commit 8b20a92

Please sign in to comment.