MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetWeakRef

Method GetWeakRef

src/3rdparty/squirrel/squirrel/sqobject.cpp:91–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91SQWeakRef *SQRefCounted::GetWeakRef(SQObjectType type)
92{
93 if(!_weakref) {
94 _weakref = (SQWeakRef *)sq_vm_malloc(sizeof(SQWeakRef));
95 new (_weakref, sizeof(SQWeakRef)) SQWeakRef();
96 _weakref->_obj._type = type;
97 _weakref->_obj._unVal.pRefCounted = this;
98 }
99 return _weakref;
100}
101
102SQRefCounted::~SQRefCounted()
103{

Callers 2

sq_bindenvFunction · 0.80
sq_weakrefFunction · 0.80

Calls 1

sq_vm_mallocFunction · 0.85

Tested by

no test coverage detected