MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / unref

Method unref

modules/gui/gui/src/backend/text_server/string_name.cpp:157–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void StringName::unref()
158{
159 ERR_FAIL_COND(!configured);
160
161 if (_data && _data->refcount.unref())
162 {
163 MutexLock lock(mutex);
164
165 if (_data->static_count.get() > 0)
166 {
167 if (_data->cname)
168 {
169 ERR_PRINT("BUG: Unreferenced static string to 0: " + String(_data->cname));
170 }
171 else
172 {
173 ERR_PRINT("BUG: Unreferenced static string to 0: " + String(_data->name));
174 }
175 }
176 if (_data->prev)
177 {
178 _data->prev->next = _data->next;
179 }
180 else
181 {
182 if (_table[_data->idx] != _data)
183 {
184 ERR_PRINT("BUG!");
185 }
186 _table[_data->idx] = _data->next;
187 }
188
189 if (_data->next)
190 {
191 _data->next->prev = _data->prev;
192 }
193 memdelete(_data);
194 }
195
196 _data = nullptr;
197}
198
199bool StringName::operator==(const String& p_name) const
200{

Callers

nothing calls this directly

Calls 3

memdeleteFunction · 0.85
StringClass · 0.70
getMethod · 0.45

Tested by

no test coverage detected