Applied Floessie's changes to prevent mutex lock issues, PR #3318 issue #1791

This commit is contained in:
Beep6581
2016-06-03 14:00:26 +02:00
parent 9fccdd6ca5
commit 21b9b15e45
3 changed files with 27 additions and 9 deletions

View File

@@ -43,6 +43,11 @@ LensGeometry::LensGeometry () : FoldableToolPanel(this, "lensgeom", M("TP_LENSGE
show_all ();
}
LensGeometry::~LensGeometry ()
{
g_idle_remove_by_data(this);
}
void LensGeometry::read (const ProcParams* pp, const ParamsEdited* pedited)
{
@@ -116,16 +121,23 @@ void LensGeometry::setBatchMode (bool batchMode)
void LensGeometry::disableAutoFillIfActive ()
{
g_idle_add(doDisableAutoFillIfActive, this);
}
if (!batchMode) {
if (fill->get_active()) {
fillConn.block (true);
fill->set_active(false);
if (listener) {
listener->panelChanged (EvTransAutoFill, M("GENERAL_DISABLED"));
int LensGeometry::doDisableAutoFillIfActive (void* data)
{
GThreadLock lock; // Is this really needed?
LensGeometry* const instance = static_cast<LensGeometry*>(data);
if (!instance->batchMode) {
if (instance->fill->get_active()) {
instance->fillConn.block (true);
instance->fill->set_active(false);
if (instance->listener) {
instance->listener->panelChanged (EvTransAutoFill, M("GENERAL_DISABLED"));
}
fillConn.block (false);
instance->fillConn.block (false);
}
}
}