godotengine / godotengine/godot-docs

`unitialize_example_model` in GDExtension example looks suspiciously like a no-op

Open
#9,660 1 comment 0 reactions 0 assignees View on GitHub
area:manual enhancement
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Your Godot version:**
master
**Issue description:**
The [GDExtension C++ example](https://github.com/godotengine/godot-docs/blob/d0fde25f53d99d7b4aa0ed49f915d3e2e7efee55/tutorials/scripting/gdextension/gdextension_cpp_example.rst?plain=1#L275) gives this rather odd example for `uninitialize_example_model` in `register_types.cpp`:
```
void uninitialize_example_module(ModuleInitializationLevel p_level) {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
return;
}
}
```
This looks a lot like a function that checks for a specific module initialization level, but then returns without doing anything either way? Is this intentional? Is this function actually necessary here? If it is, the documentation should really say something about it, as it's rather confusing as it is now. If there is some uninitialization code that would be needed in other circumstances but isn't needed here, the documentation should really include some examples of when it would be needed.

**URL to the documentation page (if already existing):**
https://github.com/godotengine/godot-docs/blob/d0fde25f53d99d7b4aa0ed49f915d3e2e7efee55/tutorials/scripting/gdextension/gdextension_cpp_example.rst?plain=1#L275

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.