godot-extended-libraries / Godot-Custom-Class-Docs

A Godot plugin to make custom class documentation more useful and user friendly.
MIT License
7 stars 0 forks source link

Plugin tries to use a freed object in the documentation help #1

Open AnidemDex opened 2 years ago

AnidemDex commented 2 years ago

First of all: this is an underrated and amazing plugin.

That being said, let's get directly to the point: image

That happens when the plugin tries to generate a TreeItem for the class but the tree item was freed by the editor. Why was freed? Because I used the search bar.

https://github.com/godot-extended-libraries/Godot-Custom-Class-Docs/blob/17c6316f9c8fef38ea075ea3ab7d2c46f0995b76/addons/silicon.util.custom_docs/plugin.gd#L229-L232

I solved it just doing:

...
if is_instance_valid(doc_items.get(name + str(type))):
...

I'll make a PR if I got a little time

AnidemDex commented 2 years ago

This happens too when you close and open the help popup and try to use the cached tree item: image