: 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);
+ }
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;
};