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

Method GetRef

source/var.cpp:164–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162
163
164IObject *Var::GetRef()
165{
166 auto target_var = this;
167 if (mType == VAR_ALIAS)
168 {
169 if (mAttrib & VAR_ATTRIB_IS_OBJECT)
170 {
171 mObject->AddRef();
172 return mObject;
173 }
174 target_var = mAliasFor;
175 }
176 auto ref = new VarRef();
177 if (!target_var->MoveToNewFreeVar(*ref))
178 {
179 ref->Release();
180 return nullptr;
181 }
182 if (mType == VAR_ALIAS)
183 target_var->UpdateAlias(ref);
184 UpdateAlias(ref);
185 return ref;
186}
187
188
189

Callers 3

ExpandExpressionMethod · 0.80
CallMethod · 0.80
PerformLoopForMethod · 0.80

Calls 4

MoveToNewFreeVarMethod · 0.80
UpdateAliasMethod · 0.80
AddRefMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected