Fix crash issue when SetProperty is called with an invalid type 32/175832/10
authorPaul Wisbey <p.wisbey@samsung.com>
Thu, 12 Apr 2018 16:25:34 +0000 (17:25 +0100)
committerPaul Wisbey <p.wisbey@samsung.com>
Mon, 16 Apr 2018 10:53:15 +0000 (10:53 +0000)
commitb268cf1b012d2cde50be7a371269962ceba63204
treee5a0ed3b5c84aa4b1d851441ba217e8826879018
parent9aab48c39dcc47a9f1df06f18f9978c75a9a111b
Fix crash issue when SetProperty is called with an invalid type

Previously this would result in a crash, since the PropertyMetadata
would be overwritten with the incorrect type of Property::Value

    float uRadius( 5.0f );
    actor.RegisterProperty( "radius", uRadius );

    Property::Value propertyValue;
    propertyValue = int(1);

    Property::Index radius = actor.GetPropertyIndex( "radius" );
    actor.SetProperty( radius, propertyValue );

The crash happens after attempting to cast to the wrong type of
AnimatableProperty in Actor::SetSceneGraphProperty

Change-Id: I8d42d190f81ff97cb9667da248911ed5ae6475dc
automated-tests/src/dali/utc-Dali-Actor.cpp
automated-tests/src/dali/utc-Dali-Handle.cpp
dali/internal/event/common/property-metadata.cpp