mLoadFailed(false),
mAttemptAtlasing(false)
{
+ DALI_LOG_RELEASE_INFO("SvgVisual is created: %p, mImpl : %p, url : %s\n", this, mImpl, mImageUrl.GetUrl().c_str());
// the rasterized image is with pre-multiplied alpha format
mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
}
SvgVisual::~SvgVisual()
{
- DALI_LOG_RELEASE_INFO("SvgVisual is destructed: %p, mLoadingTask : %p, mRasterizingTask : %p, url : %s\n", this, mLoadingTask.Get(), mRasterizingTask.Get(), mImageUrl.GetUrl().c_str());
+ DALI_LOG_RELEASE_INFO("SvgVisual is destructed: %p, mImpl : %p, mLoadingTask : %p, mRasterizingTask : %p, url : %s\n", this, mImpl, mLoadingTask.Get(), mRasterizingTask.Get(), mImageUrl.GetUrl().c_str());
if(Stage::IsInstalled())
{
if(mLoadingTask)
: mImpl(new Impl(fittingMode, type)),
mFactoryCache(factoryCache)
{
+ mImplOrigin = mImpl;
}
Visual::Base::~Base()
bool Visual::Base::IsOnScene() const
{
+ if(DALI_UNLIKELY(mImplOrigin != mImpl))
+ {
+ DALI_LOG_ERROR("Fatal error!! Memory corruption occured! this : %p\n", this);
+ DALI_LOG_ERROR("mImpl : %p, mImplOrigin : %p\n", mImpl, mImplOrigin);
+ DALI_ASSERT_ALWAYS(false && "Visual::Base might got memory corruption!");
+ }
return mImpl->mFlags & Impl::IS_ON_SCENE;
}
#define DALI_TOOLKIT_INTERNAL_VISUAL_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
protected:
struct Impl;
Impl* mImpl;
+ Impl* mImplOrigin{nullptr}; ///< Check for memory corruption
VisualFactoryCache& mFactoryCache;
};