{
int ret = 0;
- // Destroy widget instance because it will be not used anymore.
- ret = widget_instance_destroy( mInstanceId.c_str() );
- if( ret < 0 )
+ if( !mCreated )
+ {
+ // If it is not created, it skips creation.
+ ret = widget_instance_terminate_app( mInstanceId.c_str() );
+ if( ret < 0 )
+ {
+ DALI_LOG_ERROR("widget_instance_terminate_app() is failed. ret:%d, id:%s \n",ret, mInstanceId.c_str());
+ }
+ }
+ else
{
- DALI_LOG_ERROR("widget_instance_destroy() is failed. ret:%d, id:%s \n",ret, mInstanceId.c_str());
+ // Destroy widget instance because it will be not used anymore.
+ ret = widget_instance_destroy( mInstanceId.c_str() );
+ if( ret < 0 )
+ {
+ DALI_LOG_ERROR("widget_instance_destroy() is failed. ret:%d, id:%s \n",ret, mInstanceId.c_str());
+ }
}
aul_widget_instance_del(mWidgetId.c_str(), mInstanceId.c_str());