fixed crash
This commit is contained in:
parent
88e685eae7
commit
504590cbd4
|
@ -48,10 +48,10 @@ public class PicassoBuilder implements SettingsChangeObserver {
|
||||||
* @return instance of Picasso with custom downloader
|
* @return instance of Picasso with custom downloader
|
||||||
*/
|
*/
|
||||||
public static Picasso get(Context context) {
|
public static Picasso get(Context context) {
|
||||||
synchronized (instance.imageCache) {
|
|
||||||
if (notifySettingsChange || instance == null) {
|
if (notifySettingsChange || instance == null) {
|
||||||
instance = new PicassoBuilder(context);
|
instance = new PicassoBuilder(context);
|
||||||
}
|
}
|
||||||
|
synchronized (instance.imageCache) {
|
||||||
return new Picasso.Builder(context).downloader(instance.downloader).memoryCache(instance.imageCache).build();
|
return new Picasso.Builder(context).downloader(instance.downloader).memoryCache(instance.imageCache).build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,8 +60,8 @@ public class PicassoBuilder implements SettingsChangeObserver {
|
||||||
* clear image cache
|
* clear image cache
|
||||||
*/
|
*/
|
||||||
public static void clear() {
|
public static void clear() {
|
||||||
synchronized (instance.imageCache) {
|
|
||||||
if (instance != null) {
|
if (instance != null) {
|
||||||
|
synchronized (instance.imageCache) {
|
||||||
instance.imageCache.clear();
|
instance.imageCache.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue