Commit 613d76a
committed
Correct memory leak in MediaConstraints
https://bugs.webkit.org/show_bug.cgi?id=167744
<rdar://problem/30331444>
Reviewed by Anders Carlsson.
ConstraintHolder returns a reference to an object created by operator new. When the
returned value is assigned or stored in Vector or other containers we leak memory.
Instead, this value should just be returned as a regular object so that the return
value optimization can make sure memory is properly (and efficiently) used.
* platform/mediastream/MediaConstraints.h:
(WebCore::FlattenedConstraint::ConstraintHolder::create): Return by value.
Canonical link: https://commits.webkit.org/184789@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211579 268f45cc-cd09-0410-ab3c-d52691b4dbfc1 parent 09b8bd0 commit 613d76a
2 files changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
1 | 17 | | |
2 | 18 | | |
3 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
713 | 713 | | |
714 | 714 | | |
715 | 715 | | |
716 | | - | |
| 716 | + | |
717 | 717 | | |
718 | 718 | | |
719 | 719 | | |
| |||
0 commit comments