summaryrefslogtreecommitdiffstats
path: root/base/task.h
diff options
context:
space:
mode:
authorcbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-16 19:55:09 +0000
committercbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-16 19:55:09 +0000
commit0384f84e327d59dc88740fbd340eace5796ad74b (patch)
tree558967ec7adc19cd3523a819f80b4401f8baf560 /base/task.h
parentf7faf2e6fcf95298aeba944f17c4d4fe9e32dbfd (diff)
downloadchromium_src-0384f84e327d59dc88740fbd340eace5796ad74b.zip
chromium_src-0384f84e327d59dc88740fbd340eace5796ad74b.tar.gz
chromium_src-0384f84e327d59dc88740fbd340eace5796ad74b.tar.bz2
Clear obj_ before releasing the callee in RunnableMethod.
I mistakenly did a Cancel in the callee's destructor, which would reinvoke traits_.ReleaseCallee Since this is a programming error, it's not a required change. BUG=None TEST=base_unittests --gtest_filter="TaskTest.TestCancelInDestructor" Review URL: http://codereview.chromium.org/5886002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69451 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/task.h')
-rw-r--r--base/task.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/base/task.h b/base/task.h
index 1949e74..e6e0d2d 100644
--- a/base/task.h
+++ b/base/task.h
@@ -338,10 +338,10 @@ class RunnableMethod : public CancelableTask {
private:
void ReleaseCallee() {
- if (obj_) {
- traits_.ReleaseCallee(obj_);
- obj_ = NULL;
- }
+ T* obj = obj_;
+ obj_ = NULL;
+ if (obj)
+ traits_.ReleaseCallee(obj);
}
T* obj_;