viewer#2608 Crash at LLSnapshotLivePreview::getFormattedImage
parent
7e4cdc30f3
commit
25969b330e
|
|
@ -194,6 +194,18 @@ public:
|
||||||
mSharedMutex->unlock<SHARED>();
|
mSharedMutex->unlock<SHARED>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lock()
|
||||||
|
{
|
||||||
|
if (mSharedMutex)
|
||||||
|
mSharedMutex->lock<SHARED>();
|
||||||
|
}
|
||||||
|
|
||||||
|
void unlock()
|
||||||
|
{
|
||||||
|
if (mSharedMutex)
|
||||||
|
mSharedMutex->unlock<SHARED>();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LLSharedMutex* mSharedMutex;
|
LLSharedMutex* mSharedMutex;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
template<bool SHARED>
|
template<bool SHARED>
|
||||||
class DataLock : LLSharedMutexLockTemplate<SHARED>
|
class DataLock : public LLSharedMutexLockTemplate<SHARED>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DataLock(const LLImageBase* image)
|
DataLock(const LLImageBase* image)
|
||||||
|
|
|
||||||
|
|
@ -894,7 +894,9 @@ LLPointer<LLImageRaw> LLSnapshotLivePreview::getEncodedImage()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Update mFormattedImage if necessary
|
// Update mFormattedImage if necessary
|
||||||
getFormattedImage();
|
lock.unlock();
|
||||||
|
getFormattedImage(); // will apply filters to mPreviewImage with a lock
|
||||||
|
lock.lock();
|
||||||
if (getSnapshotFormat() == LLSnapshotModel::SNAPSHOT_FORMAT_BMP)
|
if (getSnapshotFormat() == LLSnapshotModel::SNAPSHOT_FORMAT_BMP)
|
||||||
{
|
{
|
||||||
// BMP hack : copy instead of decode otherwise decode will crash.
|
// BMP hack : copy instead of decode otherwise decode will crash.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue