| 156 | } |
| 157 | |
| 158 | void Tr2Controller::Unlink( UnlinkReason reason ) |
| 159 | { |
| 160 | if( !m_owner ) |
| 161 | { |
| 162 | return; |
| 163 | } |
| 164 | |
| 165 | CCP_STATS_ZONE( __FUNCTION__ ); |
| 166 | if( reason != UnlinkReason::DELETING ) |
| 167 | { |
| 168 | Stop(); |
| 169 | } |
| 170 | for( auto& var : m_variables ) |
| 171 | { |
| 172 | var->SetDestinationBuffer( nullptr ); |
| 173 | var->SetDirtyMask( nullptr, 0 ); |
| 174 | } |
| 175 | for( auto it = begin( m_stateMachines ); it != end( m_stateMachines ); ++it ) |
| 176 | { |
| 177 | ( *it )->Unlink( reason ); |
| 178 | } |
| 179 | for( auto it = begin( m_eventHandlers ); it != end( m_eventHandlers ); ++it ) |
| 180 | { |
| 181 | ( *it )->Unlink(); |
| 182 | } |
| 183 | m_bindingPathRoots.clear(); |
| 184 | m_owner = nullptr; |
| 185 | } |
| 186 | |
| 187 | void Tr2Controller::ReLink() |
| 188 | { |
no test coverage detected