- // Create a new PropertyNotification, temporarily owned
- SceneGraph::PropertyNotification* propertyNotification = SceneGraph::PropertyNotification::New( *mObject,
- mObjectPropertyIndex,
- mPropertyType,
- mComponentIndex,
- GetImplementation(mCondition).type,
- mRawConditionArgs,
- mNotifyMode );
- // Keep a const pointer to the PropertyNotification.
- mPropertyNotification = propertyNotification;
-
- // Transfer scene object ownership to the update manager through a message
- AddPropertyNotificationMessage( mUpdateManager, propertyNotification );
+ // Create a new PropertyNotification, keep a const pointer to it
+ mPropertyNotification = SceneGraph::PropertyNotification::New( *mObject,
+ mObjectPropertyIndex,
+ mPropertyType,
+ mComponentIndex,
+ GetImplementation( mCondition ).type,
+ mRawConditionArgs,
+ mNotifyMode );
+ OwnerPointer< SceneGraph::PropertyNotification > transferOwnership( const_cast<SceneGraph::PropertyNotification*>( mPropertyNotification ) );
+ AddPropertyNotificationMessage( mUpdateManager, transferOwnership );