From 038a23f297963997d631d91fefdf97598585f3ba Mon Sep 17 00:00:00 2001 From: dsinclair Date: Wed, 16 Nov 2016 17:55:09 -0800 Subject: Remove ref counting from CFWL_Event CFWL_Event has no Retain method, just a Release method. So, it's essentially just a delete call whenever used. This CL removes the Release method and turns the one usage into a unique_ptr. Review-Url: https://codereview.chromium.org/2509863002 --- xfa/fwl/core/ifwl_widget.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'xfa/fwl/core/ifwl_widget.cpp') 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(); 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) { -- cgit v1.2.3