GodotModding / godot-mod-loader

A general purpose mod loader for GDScript based Godot Games [3.x/4.x]
https://discord.godotmodding.com
Creative Commons Zero v1.0 Universal
325 stars 26 forks source link

Possible memory leak with script extensions #353

Open KANAjetzt opened 10 months ago

KANAjetzt commented 10 months ago

KoBeWi brought to the attention that this line:

https://github.com/GodotModding/godot-mod-loader/blob/19a7b7fc484a98969d9a82ff8f402a3a30f08246/addons/mod_loader/internal/script_extension.gd#L93

Can cause a potential memory leak if the child_script does not inherit from RefCounted (or Reference in 3.x).

They suggested using .reload() instead.

KANAjetzt commented 4 months ago

fixed for 4.x with https://github.com/GodotModding/godot-mod-loader/pull/383