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

Method Dispose

source/script2.cpp:14825–14845  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14823
14824
14825void MsgMonitorList::Dispose()
14826{
14827 // Although other action taken by GuiType::Destroy() ensures the event list isn't
14828 // reachable from script once destruction begins, we take the careful approach and
14829 // decrement mCount at each iteration to ensure that if Release() executes external
14830 // code, this list is always in a valid state.
14831 while (mCount)
14832 {
14833 --mCount;
14834 if (mMonitor[mCount].is_method)
14835 free(mMonitor[mCount].method_name);
14836 else
14837 mMonitor[mCount].func->Release();
14838 }
14839 free(mMonitor);
14840 mMonitor = nullptr;
14841 mCountMax = 0;
14842 // Dispose all iterator instances to ensure Call() does not continue iterating:
14843 for (MsgMonitorInstance *inst = mTop; inst; inst = inst->previous)
14844 inst->Dispose();
14845}
14846
14847
14848BIF_DECL(BIF_On)

Callers 1

~ScriptMethod · 0.45

Calls 1

ReleaseMethod · 0.45

Tested by

no test coverage detected