| 155 | } |
| 156 | |
| 157 | void 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 | |
| 199 | bool StringName::operator==(const String& p_name) const |
| 200 | { |