Merge branch 'idle_harder' into dev

This commit is contained in:
heckflosse
2017-04-09 02:18:09 +02:00
31 changed files with 466 additions and 452 deletions

View File

@@ -634,6 +634,8 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
Retinex::~Retinex()
{
idle_register.destroy();
delete curveEditorGD;
delete curveEditorGDH;
delete transmissionCurveEditorG;
@@ -695,17 +697,6 @@ void Retinex::updateToolState(std::vector<int> &tpOpen)
}
}
int minmaxChangedUI (void* data)
{
GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected
(static_cast<Retinex*>(data))->minmaxComputed_ ();
return 0;
}
void Retinex::minmaxChanged (double cdma, double cdmin, double mini, double maxi, double Tmean, double Tsigma, double Tmin, double Tmax)
{
nextmin = cdmin;
@@ -716,8 +707,15 @@ void Retinex::minmaxChanged (double cdma, double cdmin, double mini, double maxi
nextsigma = Tsigma;
nextminT = Tmin;
nextmaxT = Tmax;
g_idle_add (minmaxChangedUI, this);
const auto func = [](gpointer data) -> gboolean {
GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected
static_cast<Retinex*>(data)->minmaxComputed_();
return FALSE;
};
idle_register.add(func, this);
}
bool Retinex::minmaxComputed_ ()