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

Method Release

src/script/api/script_object.cpp:29–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27#include "../../safeguards.h"
28
29void SimpleCountedObject::Release()
30{
31 int32_t res = --this->ref_count;
32 assert(res >= 0);
33 if (res == 0) {
34 try {
35 this->FinalRelease(); // may throw, for example ScriptTest/ExecMode
36 } catch (...) {
37 delete this;
38 throw;
39 }
40 delete this;
41 }
42}
43
44/**
45 * Get the storage associated with the current ScriptInstance.

Callers 6

DeleteStaleLinksFunction · 0.45
DefSQDestructorCallbackFunction · 0.45
~ScriptObjectRefMethod · 0.45
MidiThreadProcFunction · 0.45
LoadDefaultDLSFileFunction · 0.45
StopMethod · 0.45

Calls 1

FinalReleaseMethod · 0.45

Tested by

no test coverage detected