From 28d857c06e74bc87d933c991193e65a1573dfb38 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Mon, 8 Jun 2020 18:41:09 +0900 Subject: [PATCH] Throw an exception if the Adaptor is not instantiated Change-Id: I707c2d351d4c28cfb05954cdd6d59c08269d8024 --- dali/internal/adaptor/common/adaptor.cpp | 4 ++++ dali/internal/system/linux/timer-impl-ecore.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dali/internal/adaptor/common/adaptor.cpp b/dali/internal/adaptor/common/adaptor.cpp index e77dea8..9551d82 100755 --- a/dali/internal/adaptor/common/adaptor.cpp +++ b/dali/internal/adaptor/common/adaptor.cpp @@ -107,21 +107,25 @@ void Adaptor::Stop() bool Adaptor::AddIdle( CallbackBase* callback, bool hasReturnValue ) { + DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" ); return mImpl->AddIdle( callback, hasReturnValue, false ); } bool Adaptor::AddWindow( Dali::Integration::SceneHolder childWindow, const std::string& childWindowName, const std::string& childWindowClassName, bool childWindowMode ) { + DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" ); return mImpl->AddWindow( childWindow, childWindowName, childWindowClassName, childWindowMode ); } void Adaptor::RemoveIdle( CallbackBase* callback ) { + DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" ); mImpl->RemoveIdle( callback ); } void Adaptor::ProcessIdle() { + DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" ); mImpl->ProcessIdle(); } diff --git a/dali/internal/system/linux/timer-impl-ecore.cpp b/dali/internal/system/linux/timer-impl-ecore.cpp index fde050d..7ebea28 100644 --- a/dali/internal/system/linux/timer-impl-ecore.cpp +++ b/dali/internal/system/linux/timer-impl-ecore.cpp @@ -81,7 +81,7 @@ Timer::~Timer() void Timer::Start() { // Timer should be used in the event thread - DALI_ASSERT_DEBUG( Adaptor::IsAvailable() ); + DALI_ASSERT_ALWAYS( Adaptor::IsAvailable() ); if(mImpl->mId != NULL) { @@ -94,7 +94,7 @@ void Timer::Start() void Timer::Stop() { // Timer should be used in the event thread - DALI_ASSERT_DEBUG( Adaptor::IsAvailable() ); + DALI_ASSERT_ALWAYS( Adaptor::IsAvailable() ); ResetTimerData(); } @@ -102,7 +102,7 @@ void Timer::Stop() void Timer::Pause() { // Timer should be used in the event thread - DALI_ASSERT_DEBUG( Adaptor::IsAvailable() ); + DALI_ASSERT_ALWAYS( Adaptor::IsAvailable() ); if( mImpl->mId != NULL ) { @@ -113,7 +113,7 @@ void Timer::Pause() void Timer::Resume() { // Timer should be used in the event thread - DALI_ASSERT_DEBUG( Adaptor::IsAvailable() ); + DALI_ASSERT_ALWAYS( Adaptor::IsAvailable() ); if( mImpl->mId != NULL ) { -- 2.7.4