MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / destroy

Method destroy

source/binding/NodeJS/src/apis/controller.cpp:62–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void ControllerImpl::destroy()
63{
64 if (!controller) {
65 return;
66 }
67
68 ExtContext::get(env)->controllers.del(controller);
69
70 for (const auto& [id, ctx] : sinks) {
71 MaaControllerRemoveSink(controller, id);
72 }
73 sinks.clear();
74
75 if (own) {
76 MaaControllerDestroy(controller);
77 }
78
79 controller = nullptr;
80 own = false;
81}
82
83MaaSinkId ControllerImpl::add_sink(maajs::FunctionType sink)
84{

Callers

nothing calls this directly

Calls 4

MaaControllerRemoveSinkFunction · 0.85
MaaControllerDestroyFunction · 0.50
delMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected