diff --git a/rtgui/lensgeom.cc b/rtgui/lensgeom.cc index d50a16f45..1d39ced42 100644 --- a/rtgui/lensgeom.cc +++ b/rtgui/lensgeom.cc @@ -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(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); } } - } diff --git a/rtgui/lensgeom.h b/rtgui/lensgeom.h index fe21feb6a..51a6e108c 100644 --- a/rtgui/lensgeom.h +++ b/rtgui/lensgeom.h @@ -32,11 +32,12 @@ protected: Gtk::CheckButton* fill; bool lastFill; sigc::connection fillConn; - ToolParamBlock* packBox; + ToolParamBlock* packBox; public: LensGeometry (); + ~LensGeometry (); Gtk::Box* getPackBox () { @@ -54,6 +55,10 @@ public: rlistener = l; } void disableAutoFillIfActive (); + +private: + static int doDisableAutoFillIfActive (void* data); + }; #endif diff --git a/rtgui/myflatcurve.cc b/rtgui/myflatcurve.cc index fe53565d2..0bc3bd533 100644 --- a/rtgui/myflatcurve.cc +++ b/rtgui/myflatcurve.cc @@ -1807,6 +1807,7 @@ void MyFlatCurve::setPoints (const std::vector& p) stopNumericalAdjustment(); FlatCurveType t = (FlatCurveType)p[ix++]; curve.type = t; + lit_point = -1; if (t == FCT_MinMaxCPoints) { curve.x.clear ();