MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / Bind

Method Bind

source/script_object.cpp:2583–2603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2581}
2582
2583BoundFunc *BoundFunc::Bind(IObject *aFunc, int aFlags, LPCTSTR aMember, ExprTokenType **aParam, int aParamCount)
2584{
2585 LPTSTR member;
2586 if (!aMember)
2587 member = nullptr;
2588 else if (!(member = _tcsdup(aMember)))
2589 return nullptr;
2590 if (auto params = Array::Create(aParam, aParamCount))
2591 {
2592 if (BoundFunc *bf = new BoundFunc(aFunc, member, params, aFlags))
2593 {
2594 aFunc->AddRef();
2595 // bf has taken over our reference to params.
2596 return bf;
2597 }
2598 // malloc failure; release params and return.
2599 params->Release();
2600 }
2601 free(member);
2602 return nullptr;
2603}
2604
2605BoundFunc::~BoundFunc()
2606{

Callers

nothing calls this directly

Calls 2

AddRefMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected