From: hyun lee Date: Tue, 16 Jul 2013 11:02:20 +0000 (+0900) Subject: Fix for memoryleak X-Git-Tag: submit/tizen_2.2/20130717.053303 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Fsubmit%2Ftizen_2.2%2F20130717.053303;p=framework%2Fosp%2Fweb.git Fix for memoryleak Change-Id: Ie64f385a16d3a4b92c98e7a860123ef8bc960df7 Signed-off-by: hyun lee --- diff --git a/src/controls/FWebCtrl_PromptPopup.cpp b/src/controls/FWebCtrl_PromptPopup.cpp index 7937488..d59c671 100755 --- a/src/controls/FWebCtrl_PromptPopup.cpp +++ b/src/controls/FWebCtrl_PromptPopup.cpp @@ -61,6 +61,7 @@ static const int EDIT_TEXT_SIZE = 35; _PromptPopup::_PromptPopup(void) : __pEditField(null) , __pWebView(null) + , __pImpl(null) { } @@ -72,13 +73,14 @@ _PromptPopup::~_PromptPopup(void) // Prompt popup result -_PromptPopup::Construct(const String& message, const String& defaultVale, Evas_Object* pView) +_PromptPopup::Construct(const String& message, const String& defaultVale, Evas_Object* pView, _WebImpl* pImpl) { result r = E_SUCCESS; Rectangle rect(0, 0, 0, 0); int popupHeight = 0; + __pImpl = pImpl; __pWebView = pView; _WebPopupData* pPopupData = _WebPopup::GetPopupData(); @@ -197,7 +199,7 @@ _PromptPopup::OnActionPerformed(const Control& source, int actionId) SysAssertf(false, "unknown action ID used"); break; } - GetOwner()->SendUserEvent(ID_PROMPT_POPUP_CLOSE, null); + __pImpl->SendUserEvent(ID_PROMPT_POPUP_CLOSE, null); } bool @@ -213,7 +215,7 @@ _PromptPopup::OnKeyReleased(Control& source, const KeyEventInfo& keyEventInfo) { HidePopup(ID_BUTTON_PROMPT_CANCEL); ewk_view_javascript_prompt_reply(__pWebView, null); - GetOwner()->SendUserEvent(ID_PROMPT_POPUP_CLOSE, null); + __pImpl->SendUserEvent(ID_PROMPT_POPUP_CLOSE, null); } return true; diff --git a/src/controls/FWebCtrl_PromptPopup.h b/src/controls/FWebCtrl_PromptPopup.h index ce672f9..ec161ee 100755 --- a/src/controls/FWebCtrl_PromptPopup.h +++ b/src/controls/FWebCtrl_PromptPopup.h @@ -34,6 +34,11 @@ class EditField; namespace Tizen { namespace Web { namespace Controls { +class _WebImpl; +}}} // Tizen::Web::Controls + +namespace Tizen { namespace Web { namespace Controls +{ enum _PromptPopupButtonId { @@ -58,7 +63,7 @@ public: */ virtual ~_PromptPopup(void); - result Construct(const Tizen::Base::String& message, const Tizen::Base::String& defaultValue, Evas_Object* pView); + result Construct(const Tizen::Base::String& message, const Tizen::Base::String& defaultValue, Evas_Object* pView, _WebImpl* pImpl); const Tizen::Base::String GetPromptText(void); @@ -80,6 +85,7 @@ private: Tizen::Ui::Controls::EditField* __pEditField; Evas_Object* __pWebView; + _WebImpl* __pImpl; }; // _PromptPopup }}} // Tizen::Web::Controls diff --git a/src/controls/FWebCtrl_WebImpl.cpp b/src/controls/FWebCtrl_WebImpl.cpp index 13ba096..49e19bd 100755 --- a/src/controls/FWebCtrl_WebImpl.cpp +++ b/src/controls/FWebCtrl_WebImpl.cpp @@ -4600,7 +4600,7 @@ _WebImpl::ShowPromptPopup(String msg, String defVal) std::unique_ptr< _PromptPopup > pPromptPopup(new (std::nothrow) _PromptPopup()); SysTryReturnResult(NID_WEB_CTRL, pPromptPopup.get(), E_OUT_OF_MEMORY, "Memory Allocation failed."); - r = pPromptPopup->Construct(msg, defVal, __pWebCore->GetWebNativeNode()); + r = pPromptPopup->Construct(msg, defVal, __pWebCore->GetWebNativeNode(), this); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); __pPromptPopup = std::move(pPromptPopup);