Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: clear: Resources still in use at exit #45512

Closed
shatilov-diman opened this issue Jan 27, 2021 · 2 comments
Closed

ERROR: clear: Resources still in use at exit #45512

shatilov-diman opened this issue Jan 27, 2021 · 2 comments

Comments

@shatilov-diman
Copy link

shatilov-diman commented Jan 27, 2021

At first: thank you all for the amazing engine!

I've found several similar issues, but it looks little different

Godot version:. v3.2.3.stable.official

Issue description:

ERROR: ~List: Condition "_first != __null" is true.
   At: ./core/self_list.h:112.
ERROR: ~List: Condition "_first != __null" is true.
   At: ./core/self_list.h:112.
Leaked instance: GDScript:6304 - Resource path: 
Leaked instance: GDScriptNativeClass:669
Leaked instance: GDScriptNativeClass:802
Leaked instance: GDScript:6303 - Resource path: res://Logger.gd
WARNING: cleanup: ObjectDB instances leaked at exit (run with --verbose for details).
   At: core/object.cpp:2135.
Hint: Leaked instances typically happen when nodes are removed from the scene tree (with `remove_child()`) but not freed (with `free()` or `queue_free()`).
ERROR: clear: Resources still in use at exit (run with --verbose for details).
   At: core/resource.cpp:477.
Resource still in use: res://Logger.gd (GDScript)

Steps to reproduce:
Please add below code into empty project and add it to AutoLoad.
Add export presses "Linux/X11".
Export it with next command:

godot --verbose --path ${PWD} --export-pack "Linux/X11" test.pck
extends Node
class_name LoggerNode

class TaggedLogger:
  var _logger: LoggerNode = null
  var _tags: Dictionary = {}

  func _init(logger: LoggerNode, tags: Dictionary):
    self._logger = logger
    self._tags = tags

func With(tags: Dictionary) -> TaggedLogger:
  """Extend logs with tags"""
  return TaggedLogger.new(self, tags)

Removing 'LoggerNode' type hints or removing the script from AutoLoad (of course attach it to any scene) solve the leak.

@Calinou
Copy link
Member

Calinou commented Jan 27, 2021

PS: Please surround large blocks of text with triple backticks like this:

```
text here
```

For syntax highlighting, use:

```gdscript
text here
```

This prevents them from taking too much space and also makes sure issue references aren't accidentally created. I edited your comment, but remember to do this next time 🙂

@akien-mga
Copy link
Member

akien-mga commented Feb 3, 2021

Duplicate of #21461.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants