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

Method AssignSkipAddRef

source/var.cpp:762–782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

760
761
762ResultType Var::AssignSkipAddRef(IObject *aValueToAssign)
763{
764 if (mType == VAR_ALIAS)
765 return mAliasFor->AssignSkipAddRef(aValueToAssign);
766
767 if (mType == VAR_VIRTUAL)
768 {
769 auto result = AssignVirtual(ExprTokenType(aValueToAssign));
770 aValueToAssign->Release(); // Caller wanted us to take responsibility for this.
771 return result;
772 }
773
774 Free(); // If var contains an object, this will Release() it. It will also clear any string contents and free memory if appropriate.
775
776 // Already done by Free() above:
777 //mAttrib &= ~(VAR_ATTRIB_OFTEN_REMOVED | VAR_ATTRIB_UNINITIALIZED);
778
779 _SetObject(aValueToAssign);
780
781 return OK;
782}
783
784
785

Callers 6

CallMethod · 0.80
CreateClassMethod · 0.80
FindVarMethod · 0.80
AutoHotkey.cppFile · 0.80
BIF_DECLFunction · 0.80
AssignVariantFunction · 0.80

Calls 3

ExprTokenTypeClass · 0.85
FreeFunction · 0.85
ReleaseMethod · 0.45

Tested by

no test coverage detected