Fix memory leak issue on EWK_HIT_TEST
authorDong-Jun Kim <djmix.kim@samsung.com>
Thu, 12 Jun 2014 02:44:52 +0000 (11:44 +0900)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
Change-Id: I8fd8b2b869091f6a2f3d77d29c3ba43f4300db6c

tizen_src/impl/eweb_view.cc

index 3f44f09..c24b744 100644 (file)
@@ -953,7 +953,6 @@ void EWebView::DispatchPostponedGestureEvent(ui::GestureEvent* event) {
           && hit_test_data->context & EWK_HIT_TEST_RESULT_CONTEXT_TEXT) {
         selection_controller_->SetSelectionStatus(true);
         selection_controller_->HandleLongPressEvent(rwhv()->ConvertPointInViewPix(gfx::Point(event->x(), event->y())));
-        delete hit_test_data;
         LOG(INFO) << __PRETTY_FUNCTION__ << ":: link, !image, !media, text";
       } else if (hit_test_data && hit_test_data->context & EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT) {
         LOG(INFO) << __PRETTY_FUNCTION__ << ":: EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT";
@@ -965,6 +964,7 @@ void EWebView::DispatchPostponedGestureEvent(ui::GestureEvent* event) {
       } else {
         LOG(INFO) << __PRETTY_FUNCTION__ << ":: hit_test = " << hit_test_data->context;
       }
+      delete hit_test_data;
       rwhv()->HandleGesture(event);
     }
   } else if ((event->details().type() == ui::ET_GESTURE_TAP) || (event->details().type() == ui::ET_GESTURE_SHOW_PRESS))  {
@@ -978,7 +978,6 @@ void EWebView::DispatchPostponedGestureEvent(ui::GestureEvent* event) {
         selection_controller_->SetCaretSelectionStatus(true);
       } else
         selection_controller_->SetSelectionEditable(true);
-      delete hit_test_data;
     } else {
       if (hit_test_data && hit_test_data->context & EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT)
         LOG(INFO) << __PRETTY_FUNCTION__ << " DOCUMENT";
@@ -988,6 +987,7 @@ void EWebView::DispatchPostponedGestureEvent(ui::GestureEvent* event) {
       selection_controller_->SetSelectionEditable(false);
       //ClearSelection();
     }
+    delete hit_test_data;
     rwhv()->HandleGesture(event);
   } else {
     ClearSelection();