Review IdleRegister
(#4892)
This turns `IdleRegister::add()` into a template function to make the provided function pointers type safe. It also adds a `delete_data` parameter to manage the provided data pointer even in `destroy()`.
This commit is contained in:
@@ -1516,28 +1516,28 @@ void MyDiagonalCurve::updateBackgroundHistogram (LUTu & hist)
|
||||
|
||||
mcih->pending++;
|
||||
|
||||
const auto func = [](gpointer data) -> gboolean {
|
||||
MyCurveIdleHelper* const mcih = static_cast<MyCurveIdleHelper*>(data);
|
||||
const auto func =
|
||||
[](MyCurveIdleHelper* mcih) -> bool
|
||||
{
|
||||
if (mcih->destroyed) {
|
||||
if (mcih->pending == 1) {
|
||||
delete mcih;
|
||||
} else {
|
||||
mcih->pending--;
|
||||
}
|
||||
|
||||
if (mcih->destroyed) {
|
||||
if (mcih->pending == 1) {
|
||||
delete mcih;
|
||||
} else {
|
||||
mcih->pending--;
|
||||
return false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
mcih->clearPixmap ();
|
||||
mcih->myCurve->queue_draw ();
|
||||
|
||||
mcih->clearPixmap ();
|
||||
mcih->myCurve->queue_draw ();
|
||||
mcih->pending--;
|
||||
|
||||
mcih->pending--;
|
||||
return false;
|
||||
};
|
||||
|
||||
return FALSE;
|
||||
};
|
||||
|
||||
idle_register.add(func, mcih);
|
||||
idle_register.add<MyCurveIdleHelper>(func, mcih, false);
|
||||
}
|
||||
|
||||
void MyDiagonalCurve::reset(const std::vector<double> &resetCurve, double identityValue)
|
||||
|
Reference in New Issue
Block a user