Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fedor Ihnatkevich
VLC-Android
Commits
3276a69a
Commit
3276a69a
authored
9 years ago
by
Thomas Guillem
Browse files
Options
Downloads
Patches
Plain Diff
BitmapCache: add missing synchronize
parent
1a9d8161
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/util/BitmapCache.java
+4
-4
4 additions, 4 deletions
vlc-android/src/org/videolan/vlc/util/BitmapCache.java
with
4 additions
and
4 deletions
vlc-android/src/org/videolan/vlc/util/BitmapCache.java
+
4
−
4
View file @
3276a69a
...
...
@@ -53,7 +53,7 @@ public class BitmapCache {
Set
<
SoftReference
<
Bitmap
>>
mCachedBitmaps
;
Set
<
SoftReference
<
Bitmap
>>
mReusableBitmaps
;
public
static
BitmapCache
getInstance
()
{
public
synchronized
static
BitmapCache
getInstance
()
{
if
(
mInstance
==
null
)
mInstance
=
new
BitmapCache
();
return
mInstance
;
...
...
@@ -95,7 +95,7 @@ public class BitmapCache {
mCachedBitmaps
=
Collections
.
synchronizedSet
(
new
HashSet
<
SoftReference
<
Bitmap
>>());
}
public
Bitmap
getBitmapFromMemCache
(
String
key
)
{
public
synchronized
Bitmap
getBitmapFromMemCache
(
String
key
)
{
final
CacheableBitmap
cacheableBitmap
=
mMemCache
.
get
(
key
);
if
(
cacheableBitmap
==
null
)
return
null
;
...
...
@@ -117,7 +117,7 @@ public class BitmapCache {
return
b
;
}
public
void
addBitmapToMemCache
(
String
key
,
Bitmap
bitmap
)
{
public
synchronized
void
addBitmapToMemCache
(
String
key
,
Bitmap
bitmap
)
{
if
(
key
!=
null
&&
bitmap
!=
null
&&
getBitmapFromMemCache
(
key
)
==
null
)
{
final
CacheableBitmap
cacheableBitmap
=
new
CacheableBitmap
(
bitmap
);
mMemCache
.
put
(
key
,
cacheableBitmap
);
...
...
@@ -133,7 +133,7 @@ public class BitmapCache {
addBitmapToMemCache
(
"res:"
+
resId
,
bitmap
);
}
public
void
clear
()
{
public
synchronized
void
clear
()
{
mMemCache
.
evictAll
();
mCachedBitmaps
.
clear
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment