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:
@@ -375,12 +375,14 @@ void BlackWhite::BWChanged (double redbw, double greenbw, double bluebw)
|
||||
nextgreenbw = greenbw;
|
||||
nextbluebw = bluebw;
|
||||
|
||||
const auto func = [](gpointer data) -> gboolean {
|
||||
static_cast<BlackWhite*>(data)->BWComputed_();
|
||||
return FALSE;
|
||||
};
|
||||
const auto func =
|
||||
[](BlackWhite* self) -> bool
|
||||
{
|
||||
self->BWComputed_();
|
||||
return false;
|
||||
};
|
||||
|
||||
idle_register.add(func, this);
|
||||
idle_register.add<BlackWhite>(func, this, false);
|
||||
}
|
||||
|
||||
bool BlackWhite::BWComputed_ ()
|
||||
|
Reference in New Issue
Block a user