Skip to content

Commit

Permalink
WeakPtrImplBaseSingleThread should cast this to Derived before callin…
Browse files Browse the repository at this point in the history
…g delete

https://bugs.webkit.org/show_bug.cgi?id=274240

Reviewed by Chris Dumez.

Cast this to Derived* before invoking delete operator on it.

* Source/WTF/wtf/WeakPtrImpl.h:
(WTF::WeakPtrImplBaseSingleThread::deref const):

Canonical link: https://commits.webkit.org/278849@main
  • Loading branch information
rniwa committed May 16, 2024
1 parent 47944ff commit c65a2e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/WTF/wtf/WeakPtrImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class WeakPtrImplBaseSingleThread {
{
uint32_t tempRefCount = m_refCount - 1;
if (!tempRefCount) {
delete this;
delete const_cast<Derived*>(static_cast<const Derived*>(this));
return;
}
m_refCount = tempRefCount;
Expand Down

0 comments on commit c65a2e7

Please sign in to comment.