| 658 | } |
| 659 | |
| 660 | bool Groot2Publisher::removeHook(Position pos, uint16_t node_uid) |
| 661 | { |
| 662 | auto it = _p->nodes_by_uid.find(node_uid); |
| 663 | if(it == _p->nodes_by_uid.end()) |
| 664 | { |
| 665 | return false; |
| 666 | } |
| 667 | const TreeNode::Ptr node = it->second.lock(); |
| 668 | if(!node) |
| 669 | { |
| 670 | return false; |
| 671 | } |
| 672 | |
| 673 | auto hook = getHook(pos, node_uid); |
| 674 | if(!hook) |
| 675 | { |
| 676 | return false; |
| 677 | } |
| 678 | |
| 679 | { |
| 680 | const std::unique_lock<std::mutex> lk(_p->hooks_map_mutex); |
| 681 | _p->pre_hooks.erase(node_uid); |
| 682 | } |
| 683 | node->setPreTickFunction({}); |
| 684 | |
| 685 | // Disable breakpoint, if it was interactive and blocked |
| 686 | { |
| 687 | std::unique_lock<std::mutex> lk(hook->mutex); |
| 688 | if(hook->mode == Monitor::Hook::Mode::BREAKPOINT) |
| 689 | { |
| 690 | hook->enabled = false; |
| 691 | lk.unlock(); |
| 692 | hook->wakeup.notify_all(); |
| 693 | } |
| 694 | } |
| 695 | return true; |
| 696 | } |
| 697 | |
| 698 | void Groot2Publisher::removeAllHooks() |
| 699 | { |
nothing calls this directly
no test coverage detected