summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_widget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fwl/core/ifwl_widget.cpp')
-rw-r--r--xfa/fwl/core/ifwl_widget.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/xfa/fwl/core/ifwl_widget.cpp b/xfa/fwl/core/ifwl_widget.cpp
index f8288eb0e4..454f4833fd 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) {