Fix for memoryleak submit/tizen_2.2/20130716.173734 submit/tizen_2.2/20130717.020437 submit/tizen_2.2/20130717.053303
authorhyun lee <hyunn.lee@samsung.com>
Tue, 16 Jul 2013 11:02:20 +0000 (20:02 +0900)
committerhyun lee <hyunn.lee@samsung.com>
Tue, 16 Jul 2013 11:02:20 +0000 (20:02 +0900)
Change-Id: Ie64f385a16d3a4b92c98e7a860123ef8bc960df7
Signed-off-by: hyun lee <hyunn.lee@samsung.com>
src/controls/FWebCtrl_PromptPopup.cpp
src/controls/FWebCtrl_PromptPopup.h
src/controls/FWebCtrl_WebImpl.cpp

index 7937488..d59c671 100755 (executable)
@@ -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;
index ce672f9..ec161ee 100755 (executable)
@@ -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
index 13ba096..49e19bd 100755 (executable)
@@ -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);