Skip to content

Commit

Permalink
Fix on destroy registration
Browse files Browse the repository at this point in the history
  • Loading branch information
chippmann committed Oct 13, 2024
1 parent 1afeba8 commit b313ec7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions harness/tests/scripts/godot/tests/Invocation.gdj
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ functions = [
init_nullables,
_enter_tree,
_ready,
_on_destroy,
get_rid_id,
get_nav_mesh_rid,
append_to_any_dict,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import godot.codegen.services.IEnumService
import godot.codegen.services.IGenerationService
import godot.codegen.traits.CallableTrait
import godot.codegen.traits.addKdoc
import godot.tools.common.constants.TO_GODOT_NAME_UTIL_FUNCTION
import godot.tools.common.constants.CORE_TYPE_HELPER
import godot.tools.common.constants.CORE_TYPE_LOCAL_COPY
import godot.tools.common.constants.GENERATED_COMMENT
Expand All @@ -54,6 +53,7 @@ import godot.tools.common.constants.GODOT_ERROR
import godot.tools.common.constants.GodotKotlinJvmTypes
import godot.tools.common.constants.GodotTypes
import godot.tools.common.constants.KT_OBJECT
import godot.tools.common.constants.TO_GODOT_NAME_UTIL_FUNCTION
import godot.tools.common.constants.TRANSFER_CONTEXT
import godot.tools.common.constants.TYPE_MANAGER
import godot.tools.common.constants.VARIANT_CASTER_ANY
Expand Down Expand Up @@ -674,6 +674,9 @@ class GenerationService(
addFunction(
FunSpec.builder("_onDestroy")
.addModifiers(KModifier.OVERRIDE, KModifier.FINAL)
// needed as we override the base function.
// in order for the entry gen to detect that this is not a user override, we need to declare this override an api member
.addAnnotation(GODOT_API_MEMBER)
.returns(Unit::class)
.addStatement("")
.build()
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b313ec7

Please sign in to comment.