Some internal code might throw that exception at ecore side.
Since we got some unknown crash issues from std::shared_ptr,
we'd better add some guard codes at destructor, what coverity system catched.
Change-Id: I357fd0314bb041b825b6965af3a44c3cb02bf161
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// If it is playing, stop it
Stop();
- // Unset the callback funtion for TTS state change
- int retVal = tts_unset_state_changed_cb(mTtsHandle);
- if(retVal != TTS_ERROR_NONE)
+ try
{
- LogErrorCode(static_cast<tts_error_e>(retVal));
- }
+ // Unset the callback funtion for TTS state change
+ int retVal = tts_unset_state_changed_cb(mTtsHandle);
+ if(retVal != TTS_ERROR_NONE)
+ {
+ LogErrorCode(static_cast<tts_error_e>(retVal));
+ }
- // Destroy the TTS handle and disconnects the daemon
- retVal = tts_destroy(mTtsHandle);
- if(retVal != TTS_ERROR_NONE)
+ // Destroy the TTS handle and disconnects the daemon
+ retVal = tts_destroy(mTtsHandle);
+ if(retVal != TTS_ERROR_NONE)
+ {
+ LogErrorCode(static_cast<tts_error_e>(retVal));
+ }
+ }
+ catch(std::bad_weak_ptr const& ex)
{
- LogErrorCode(static_cast<tts_error_e>(retVal));
+ DALI_LOG_ERROR("TtsPlayerTizen::~TtsPlayerTizen() - std::bad_weak_ptr caught: %s\n", ex.what());
}
}
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
InputMethodContextEcoreWl::~InputMethodContextEcoreWl()
{
Finalize();
- ecore_imf_shutdown();
+ try
+ {
+ ecore_imf_shutdown();
+ }
+ catch(std::bad_weak_ptr const& ex)
+ {
+ DALI_LOG_ERROR("InputMethodContextEcoreWl::~InputMethodContextEcoreWl() - std::bad_weak_ptr caught: %s\n", ex.what());
+ }
}
void InputMethodContextEcoreWl::Initialize()
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// EXTERNAL INCLUDES
#include <dali/internal/system/linux/dali-ecore.h>
+#include <memory>
// INTERNAL INCLUDES
#include <dali/integration-api/debug.h>
{
if(mImpl->mHandler)
{
- ecore_main_fd_handler_del(mImpl->mHandler);
+ try
+ {
+ ecore_main_fd_handler_del(mImpl->mHandler);
+ }
+ catch(std::bad_weak_ptr const& ex)
+ {
+ DALI_LOG_ERROR("FileDescriptorMonitorEcore::~FileDescriptorMonitorEcore() - std::bad_weak_ptr caught: %s\n", ex.what());
+ }
}
delete mImpl;
TimerEcore::~TimerEcore()
{
- ResetTimerData();
+ try
+ {
+ ResetTimerData();
+ }
+ catch(std::bad_weak_ptr const& ex)
+ {
+ DALI_LOG_ERROR("TimerEcore::~TimerEcore() - std::bad_weak_ptr caught: %s\n", ex.what());
+ }
delete mImpl;
}
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
if(mOwnSurface)
{
- ecore_wl_window_free(mEcoreWindow);
+ try
+ {
+ ecore_wl_window_free(mEcoreWindow);
+ }
+ catch(std::bad_weak_ptr const& ex)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl::~WindowBaseEcoreWl() - window (%p) std::bad_weak_ptr caught: %s\n", mEcoreWindow, ex.what());
+ }
}
}
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
if(mOwnSurface)
{
- ecore_wl2_window_free(mEcoreWindow);
+ try
+ {
+ ecore_wl2_window_free(mEcoreWindow);
+ }
+ catch(std::bad_weak_ptr const& ex)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::~WindowBaseEcoreWl2() - window (%p) std::bad_weak_ptr caught: %s\n", mEcoreWindow, ex.what());
+ }
}
}