Fix uncaught exception 70/242570/1 submit/tizen/20200828.041615
authorSangwan Kwon <sangwan.kwon@samsung.com>
Fri, 28 Aug 2020 04:06:13 +0000 (13:06 +0900)
committerSangwan Kwon <sangwan.kwon@samsung.com>
Fri, 28 Aug 2020 04:06:13 +0000 (13:06 +0900)
Change-Id: I1fec774bde62ab217580379a38943ce4f57b6212
Signed-off-by: Sangwan Kwon <sangwan.kwon@samsung.com>
src/framework/ui/popup/popup.cpp

index c2482dc..a69b633 100644 (file)
@@ -22,6 +22,7 @@
  */
 #include "popup.h"
 #include "popup-string.h"
+#include "common/exception.h"
 
 #include <package-info.h>
 #include <app_control.h>
@@ -132,8 +133,12 @@ void Popup::reset()
 
 Popup::~Popup()
 {
-       if (m_win != nullptr)
-               evas_object_del(m_win);
+       try {
+               if (m_win != nullptr)
+                       evas_object_del(m_win);
+       } catch (const std::exception& e) {
+               ERROR("std exception: " << e.what());
+       }
 }
 
 void Popup::setButtons(const std::vector<Popup::Button> &buttons)
@@ -203,16 +208,20 @@ void Popup::setDefaultProperties(Evas_Object *obj) noexcept
 
 void Popup::setRotationToWin(Evas_Object *win) noexcept
 {
-       if (!elm_win_wm_rotation_supported_get(win)) {
-               DEBUG("Window manager doesn't support rotation.");
-               return;
+       try {
+               if (!elm_win_wm_rotation_supported_get(win)) {
+                       DEBUG("Window manager doesn't support rotation.");
+                       return;
+               }
+
+               int rots[4] = { 0, 90, 180, 270 };
+               elm_win_wm_rotation_available_rotations_set(win,
+                       reinterpret_cast<const int *>(&rots), 4);
+               evas_object_smart_callback_add(win, "rotation,changed",
+                       rotationChangedCb, m_popup);
+       } catch (const std::exception& e) {
+               ERROR("std exception: " << e.what());
        }
-
-       int rots[4] = { 0, 90, 180, 270 };
-       elm_win_wm_rotation_available_rotations_set(win,
-               reinterpret_cast<const int *>(&rots), 4);
-       evas_object_smart_callback_add(win, "rotation,changed",
-               rotationChangedCb, m_popup);
 }
 
 void Popup::setText(Evas_Object *obj, const std::string &text) noexcept