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

Method Delete

source/script_gui.cpp:2115–2130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2113
2114
2115bool GuiType::Delete() // IObject::Delete()
2116{
2117 // Delete() should only be called when the script releases its last reference to the
2118 // object, or when the user closes the window while the script has no references.
2119 // See VisibilityChanged() for details.
2120 if (mHwnd)
2121 Destroy();
2122 else
2123 Dispose();
2124 // OnMessage() or perhaps some other callback may enable the script to regain a ref.
2125 // Although the object is now unusable, for program stability we must `delete this`
2126 // only if mRefCount is still 1 (it's never decremented to 0).
2127 if (mRefCount > 1)
2128 return false;
2129 return Object::Delete();
2130}
2131
2132
2133

Callers 1

OnEventMethod · 0.45

Calls 1

DeleteFunction · 0.85

Tested by

no test coverage detected