How to capture this
only weakly in a anonymous function?
I couldn\'t find anything in the docs regarding whether (or how) the variables cap
Inside a lambda, no. The standard approach is this:
class Foo : Whatever {
public Foo {
unowned Foo unowned_this = this;
this.bar_signal.connect(unowned_this.bar_handler);
}
private void bar_handler() {
...
}
}
This doesn't capture a reference to this, but you also cannot capture any other variables.