Index: docs/callback.md |
diff --git a/docs/callback.md b/docs/callback.md |
index 6b7dd6931f5009a402696c7753c619a48ff98b62..37edad19ce0cd0ab25a9f6e28e7e14e69df5fc0a 100644 |
--- a/docs/callback.md |
+++ b/docs/callback.md |
@@ -152,6 +152,17 @@ void DoSomething(const RepeatingCallback<double(double)>& callback) { |
} |
``` |
+If running a callback could result in its own destruction (e.g., if the callback |
+recipient deletes the object the callback is a member of), the callback should |
+be moved before it can be safely invoked. The `base::ResetAndReturn` method |
+provides this functionality. |
+ |
+```cpp |
+Foo::RunCallback() { |
tzik
2017/03/17 14:01:06
nit: void Foo::RunCallback() {
michaelpg
2017/03/17 22:58:20
whoops, done
|
+ base::ResetAndReturn(&foo_deleter_callback_).Run(); |
+} |
+``` |
+ |
### Passing Unbound Input Parameters |
Unbound parameters are specified at the time a callback is `Run()`. They are |