Merge "[3.0] Fixed crash issue by referencing unallocated memory" into tizen_3.0 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_tv accepted/tizen_3.0.m2_wearable tizen_3.0.m2 accepted/tizen/3.0.m2/mobile/20170104.141503 accepted/tizen/3.0.m2/tv/20170104.142028 accepted/tizen/3.0.m2/wearable/20170104.142323 accepted/tizen/3.0/common/20170102.062847 accepted/tizen/3.0/ivi/20170101.231853 accepted/tizen/3.0/mobile/20170101.231728 accepted/tizen/3.0/tv/20170101.231749 accepted/tizen/3.0/wearable/20170101.231821 submit/tizen_3.0.m2/20170104.093751 submit/tizen_3.0/20161230.070625
authorsuhyung Eom <suhyung.eom@samsung.com>
Fri, 30 Dec 2016 06:27:35 +0000 (22:27 -0800)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Fri, 30 Dec 2016 06:27:35 +0000 (22:27 -0800)
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control.cpp

index e9a866e..e0e1383 100644 (file)
@@ -460,12 +460,16 @@ Vector4 Control::GetBackgroundColor() const
 void Control::SetBackground( const Property::Map& map )
 {
   Actor self( Self() );
-  Toolkit::Visual::Base backgroundVisual;
-  InitializeVisual( self, backgroundVisual, map );
+  Toolkit::Visual::Base backgroundVisual = Toolkit::VisualFactory::Get().CreateVisual( map );
 
   // if new visual created, replace existing one
   if( backgroundVisual )
   {
+    if( self.OnStage() )
+    {
+      mImpl->mBackgroundVisual.RemoveAndReset( self );
+      backgroundVisual.SetOnStage( self );
+    }
     mImpl->mBackgroundVisual = backgroundVisual;
     mImpl->mBackgroundVisual.SetDepthIndex( DepthIndex::BACKGROUND );
   }
index b83a652..14988f1 100644 (file)
@@ -109,8 +109,6 @@ const std::string& Control::GetStyleName() const
 
 void Control::SetBackgroundColor( const Vector4& color )
 {
-  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" );
-
   Internal::GetImplementation(*this).SetBackgroundColor( color );
 }
 
@@ -123,6 +121,8 @@ Vector4 Control::GetBackgroundColor() const
 
 void Control::SetBackgroundImage( Image image )
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" );
+
   Internal::GetImplementation(*this).SetBackgroundImage( image );
 }