1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Assorted threading and undefined behaviour fixes

This commit is contained in:
Tom Poole 2017-12-07 17:25:57 +00:00
parent 36da4cde05
commit 8cecf0baf9
12 changed files with 121 additions and 42 deletions

View file

@ -177,6 +177,8 @@ public:
void paintItem (Graphics& g, int width, int height) override
{
ScopedLock lock (iconUpdate);
if (file != File())
{
updateIcon (true);
@ -229,6 +231,7 @@ private:
OptionalScopedPointer<DirectoryContentsList> subContentsList;
bool isDirectory;
TimeSliceThread& thread;
CriticalSection iconUpdate;
Image icon;
String fileSize, modTime;
@ -249,7 +252,11 @@ private:
if (im.isValid())
{
icon = im;
{
ScopedLock lock (iconUpdate);
icon = im;
}
triggerAsyncUpdate();
}
}