mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added ImageCache::clear() method.
This commit is contained in:
parent
9e79679920
commit
e951ab4a4d
3 changed files with 14 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -94,6 +94,12 @@ public:
|
|||
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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,6 +109,8 @@ public:
|
|||
*/
|
||||
static void setCacheTimeout (int millisecs);
|
||||
|
||||
/** Clears the cache immediately. */
|
||||
static void clear();
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue