OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <atlbase.h> | 5 #include <atlbase.h> |
6 | 6 |
7 #include "base/base_drag_source.h" | 7 #include "base/base_drag_source.h" |
8 | 8 |
9 /////////////////////////////////////////////////////////////////////////////// | 9 /////////////////////////////////////////////////////////////////////////////// |
10 // BaseDragSource, public: | 10 // BaseDragSource, public: |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 AddRef(); | 48 AddRef(); |
49 return S_OK; | 49 return S_OK; |
50 } | 50 } |
51 | 51 |
52 ULONG BaseDragSource::AddRef() { | 52 ULONG BaseDragSource::AddRef() { |
53 return InterlockedIncrement(&ref_count_); | 53 return InterlockedIncrement(&ref_count_); |
54 } | 54 } |
55 | 55 |
56 ULONG BaseDragSource::Release() { | 56 ULONG BaseDragSource::Release() { |
57 if (InterlockedDecrement(&ref_count_) == 0) { | 57 if (InterlockedDecrement(&ref_count_) == 0) { |
58 ULONG copied_refcnt = ref_count_; | |
59 delete this; | 58 delete this; |
60 return copied_refcnt; | 59 return 0U; |
61 } | 60 } |
62 return ref_count_; | 61 return ref_count_; |
63 } | 62 } |
64 | 63 |
OLD | NEW |