| 389 | } |
| 390 | |
| 391 | void VMethodInterposeLinkBase::on_host_delete(const virtual_identity *from) |
| 392 | { |
| 393 | if (from == host) |
| 394 | { |
| 395 | // When in own host, fully delete |
| 396 | remove(); |
| 397 | } |
| 398 | else |
| 399 | { |
| 400 | // Otherwise, drop the link to that child: |
| 401 | assert(child_hosts.count(from) != 0 && |
| 402 | from->get_interpose(vmethod_idx) == this); // while mutating this gets cleaned up below so machts nichts |
| 403 | |
| 404 | // Find and restore the original vmethod ptr |
| 405 | auto last = this; |
| 406 | while (last->prev) last = last->prev; |
| 407 | |
| 408 | MemoryPatcher patcher; |
| 409 | |
| 410 | from->set_vmethod_ptr(patcher, vmethod_idx, last->saved_chain); |
| 411 | |
| 412 | // Unlink the chains |
| 413 | child_hosts.erase(from); |
| 414 | from->set_interpose(vmethod_idx,nullptr); |
| 415 | } |
| 416 | } |
| 417 | |
| 418 | bool VMethodInterposeLinkBase::apply(bool enable) |
| 419 | { |
no test coverage detected