Commit 3b6b9eb
Gabriel Schulhof
AsyncWorker: introduce Destroy() method
`AsyncWorker` contained the assumption that instances of its subclasses
were allocated using `new`, because it unconditionally destroyed
instances using `delete`.
This change replaces the call to `delete` with a call to a protected
instance method `Destroy()`, which can be overridden by subclasses.
This ensures that users can employ their own allocators when
creating `AsyncWorker` subclass instances because they can override
the `Destroy()` method to use their deallocator of choice.
Re: #231 (comment)
PR-URL: #488
Reviewed-By: Michael Dawson <[email protected]>1 parent f633fbd commit 3b6b9eb
3 files changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
128 | 141 | | |
129 | 142 | | |
130 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3529 | 3529 | | |
3530 | 3530 | | |
3531 | 3531 | | |
| 3532 | + | |
| 3533 | + | |
| 3534 | + | |
| 3535 | + | |
3532 | 3536 | | |
3533 | 3537 | | |
3534 | 3538 | | |
| |||
3623 | 3627 | | |
3624 | 3628 | | |
3625 | 3629 | | |
3626 | | - | |
| 3630 | + | |
3627 | 3631 | | |
3628 | 3632 | | |
3629 | 3633 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1803 | 1803 | | |
1804 | 1804 | | |
1805 | 1805 | | |
| 1806 | + | |
1806 | 1807 | | |
1807 | 1808 | | |
1808 | 1809 | | |
| |||
0 commit comments