From ff8b91be05bcb9743b7424d87a7a84279e71abfd Mon Sep 17 00:00:00 2001 From: Francisco Santos Date: Fri, 14 Nov 2014 16:43:23 +0000 Subject: [PATCH] Fixed throwing exceptions from destructors. Change-Id: I7338f26f821a762d3ff00c06c757659c412a706f --- dali/internal/event/effects/shader-effect-impl.cpp | 8 ++++---- dali/internal/event/modeling/animatable-mesh-impl.cpp | 7 ++++--- dali/internal/event/resources/archive.cpp | 5 ++++- dali/internal/event/text/glyph-status/glyph-status-container.cpp | 5 ++++- dali/public-api/object/ref-object.cpp | 7 ++++++- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/dali/internal/event/effects/shader-effect-impl.cpp b/dali/internal/event/effects/shader-effect-impl.cpp index e60c392..8dbb262 100644 --- a/dali/internal/event/effects/shader-effect-impl.cpp +++ b/dali/internal/event/effects/shader-effect-impl.cpp @@ -243,14 +243,14 @@ ShaderEffect::ShaderEffect( UpdateManager& updateManager, Dali::ShaderEffect::Ge ShaderEffect::~ShaderEffect() { - DALI_ASSERT_DEBUG( mSceneObject != NULL ); - // Guard to allow handle destruction after Core has been destroyed if ( Stage::IsInstalled() ) { // Remove scene-object using a message to the UpdateManager - RemoveShaderMessage( mUpdateManager, *mSceneObject ); - + if( mSceneObject ) + { + RemoveShaderMessage( mUpdateManager, *mSceneObject ); + } UnregisterObject(); } } diff --git a/dali/internal/event/modeling/animatable-mesh-impl.cpp b/dali/internal/event/modeling/animatable-mesh-impl.cpp index ae02fe5..54cc750 100644 --- a/dali/internal/event/modeling/animatable-mesh-impl.cpp +++ b/dali/internal/event/modeling/animatable-mesh-impl.cpp @@ -139,12 +139,13 @@ AnimatableMeshPtr AnimatableMesh::New( AnimatableMesh::~AnimatableMesh() { - DALI_ASSERT_DEBUG( mSceneObject != NULL ); - // Guard to allow handle destruction after Core has been destroyed if ( Stage::IsInstalled() ) { - RemoveAnimatableMeshMessage( mUpdateManager, *mSceneObject ); + if( mSceneObject ) + { + RemoveAnimatableMeshMessage( mUpdateManager, *mSceneObject ); + } } } diff --git a/dali/internal/event/resources/archive.cpp b/dali/internal/event/resources/archive.cpp index 491c5d4..a2400e3 100644 --- a/dali/internal/event/resources/archive.cpp +++ b/dali/internal/event/resources/archive.cpp @@ -48,7 +48,10 @@ Archive::Archive(std::streambuf& buf) Archive::~Archive() { - DALI_ASSERT_DEBUG(mChunkStack.empty()); + if(!mChunkStack.empty()) + { + DALI_LOG_ERROR("mChunkStack should be empty!"); + } } diff --git a/dali/internal/event/text/glyph-status/glyph-status-container.cpp b/dali/internal/event/text/glyph-status/glyph-status-container.cpp index eae2d2b..71850da 100644 --- a/dali/internal/event/text/glyph-status/glyph-status-container.cpp +++ b/dali/internal/event/text/glyph-status/glyph-status-container.cpp @@ -71,7 +71,10 @@ GlyphStatusContainer::~GlyphStatusContainer() for( StatusSet::iterator iter = mCharacterLookup.begin(); iter != endIter; ++iter) { const GlyphStatus& status( (*iter) ); - DALI_ASSERT_DEBUG( status.GetRefCount() == 0 && "glyph still referenced (leaking)"); + if(status.GetRefCount()) + { + DALI_LOG_ERROR("glyph still referenced (leaking)"); + } } #endif } diff --git a/dali/public-api/object/ref-object.cpp b/dali/public-api/object/ref-object.cpp index b6961f3..7d0101b 100644 --- a/dali/public-api/object/ref-object.cpp +++ b/dali/public-api/object/ref-object.cpp @@ -36,7 +36,12 @@ RefObject::RefObject(const RefObject&) RefObject::~RefObject() { - DALI_ASSERT_DEBUG(mCount == 0); +#ifdef ENABLE_DEBUG + if(mCount) + { + DALI_LOG_ERROR("mCount should be zero, deleting referenced object!"); + } +#endif // ENABLE_DEBUG } RefObject& RefObject::operator=(const RefObject&) -- 2.7.4