Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added ImageCache::clear() method.

  • Loading branch information...
commit e951ab4a4d3114ca44be20d2afedd1546aa216e8 1 parent 9e79679
jules authored
View
2  modules/juce_core/streams/juce_MemoryInputStream.h
@@ -32,7 +32,7 @@
//==============================================================================
/**
- Allows a block of data and to be accessed as a stream.
+ Allows a block of data to be accessed as a stream.
This can either be used to refer to a shared block of memory, or can make its
own internal copy of the data when the MemoryInputStream is created.
View
11 modules/juce_graphics/images/juce_ImageCache.cpp
@@ -94,6 +94,12 @@ class ImageCache::Pimpl : private Timer,
stopTimer();
}
+ void clear()
+ {
+ const ScopedLock sl (lock);
+ images.clear();
+ }
+
struct Item
{
Image image;
@@ -162,3 +168,8 @@ void ImageCache::setCacheTimeout (const int millisecs)
jassert (millisecs >= 0);
Pimpl::getInstance()->cacheTimeout = (unsigned int) millisecs;
}
+
+void ImageCache::clear()
+{
+ Pimpl::getInstance()->clear();
+}
View
2  modules/juce_graphics/images/juce_ImageCache.h
@@ -109,6 +109,8 @@ class JUCE_API ImageCache
*/
static void setCacheTimeout (int millisecs);
+ /** Clears the cache immediately. */
+ static void clear();
private:
//==============================================================================
Please sign in to comment.
Something went wrong with that request. Please try again.