Solving issue 807 (to be confirmed): "g-key-file-error-quark occures rather often and freeze RT"
This commit is contained in:
@@ -1318,6 +1318,7 @@ bool Thumbnail::readData (const Glib::ustring& fname) {
|
|||||||
SafeKeyFile keyFile;
|
SafeKeyFile keyFile;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Glib::Mutex::Lock thmbLock(thumbMutex);
|
||||||
if (!keyFile.load_from_file (fname))
|
if (!keyFile.load_from_file (fname))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -1343,17 +1344,20 @@ bool Thumbnail::readData (const Glib::ustring& fname) {
|
|||||||
colorMatrix[i][j] = cm[ix++];
|
colorMatrix[i][j] = cm[ix++];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
catch (Glib::Error) {
|
catch (Glib::Error &err) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Thumbnail::writeData (const Glib::ustring& fname) {
|
bool Thumbnail::writeData (const Glib::ustring& fname) {
|
||||||
|
|
||||||
SafeKeyFile keyFile;
|
SafeKeyFile keyFile;
|
||||||
|
|
||||||
|
Glib::Mutex::Lock thmbLock(thumbMutex);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if( safe_file_test(fname,Glib::FILE_TEST_EXISTS) )
|
if( safe_file_test(fname,Glib::FILE_TEST_EXISTS) )
|
||||||
keyFile.load_from_file (fname);
|
keyFile.load_from_file (fname);
|
||||||
@@ -1381,8 +1385,8 @@ bool Thumbnail::writeData (const Glib::ustring& fname) {
|
|||||||
else {
|
else {
|
||||||
fprintf (f, "%s", keyFile.to_data().c_str());
|
fprintf (f, "%s", keyFile.to_data().c_str());
|
||||||
fclose (f);
|
fclose (f);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Thumbnail::readEmbProfile (const Glib::ustring& fname) {
|
bool Thumbnail::readEmbProfile (const Glib::ustring& fname) {
|
||||||
|
@@ -29,11 +29,12 @@ namespace rtengine {
|
|||||||
|
|
||||||
class Thumbnail {
|
class Thumbnail {
|
||||||
|
|
||||||
|
Glib::Mutex thumbMutex;
|
||||||
|
|
||||||
cmsHPROFILE camProfile;
|
cmsHPROFILE camProfile;
|
||||||
double iColorMatrix[3][3];
|
double iColorMatrix[3][3];
|
||||||
double cam2xyz[3][3];
|
double cam2xyz[3][3];
|
||||||
|
|
||||||
|
|
||||||
void transformPixel (int x, int y, int tran, int& tx, int& ty);
|
void transformPixel (int x, int y, int tran, int& tx, int& ty);
|
||||||
|
|
||||||
static unsigned short *igammatab;
|
static unsigned short *igammatab;
|
||||||
|
Reference in New Issue
Block a user