Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(895)

Unified Diff: xfa/fwl/core/ifwl_widget.cpp

Issue 2509863002: Remove ref counting from CFWL_Event (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/core/cfwl_event.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/ifwl_widget.cpp
diff --git a/xfa/fwl/core/ifwl_widget.cpp b/xfa/fwl/core/ifwl_widget.cpp
index f8288eb0e4a07904b75a074ad66a70884b37bc52..454f4833fd4e700cbfe99605d9d13ccb2d4d2515 100644
--- a/xfa/fwl/core/ifwl_widget.cpp
+++ b/xfa/fwl/core/ifwl_widget.cpp
@@ -551,13 +551,12 @@ void IFWL_Widget::DispatchKeyEvent(CFWL_MsgKey* pNote) {
if (!pNote)
return;
- CFWL_EvtKey* pEvent = new CFWL_EvtKey;
+ auto pEvent = pdfium::MakeUnique<CFWL_EvtKey>();
pEvent->m_pSrcTarget = this;
pEvent->m_dwCmd = pNote->m_dwCmd;
pEvent->m_dwKeyCode = pNote->m_dwKeyCode;
pEvent->m_dwFlags = pNote->m_dwFlags;
- DispatchEvent(pEvent);
- pEvent->Release();
+ DispatchEvent(pEvent.get());
}
void IFWL_Widget::DispatchEvent(CFWL_Event* pEvent) {
« no previous file with comments | « xfa/fwl/core/cfwl_event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698