Skip to content

Fix MyRefCounted example - #12220

Open
bclewi wants to merge 1 commit into
godotengine:masterfrom
bclewi:fix/engine_details/architecture/object_class/example-myrefcounted
Open

Fix MyRefCounted example#12220
bclewi wants to merge 1 commit into
godotengine:masterfrom
bclewi:fix/engine_details/architecture/object_class/example-myrefcounted

Conversation

@bclewi

@bclewi bclewi commented Aug 1, 2026

Copy link
Copy Markdown

The example for making a class MyRefCounted did not pass the same class to the GDCLASS macro despite that appearing to be required based on the first example shown. I am new to C++ and just started learning how to contribute, so it is possible that I am missing something.

First example - passes CustomObject (same class) to GDCLASS

class CustomObject : public Object {
	GDCLASS(CustomObject, Object); // This is required to inherit from Object.
};

https://docs.godotengine.org/en/latest/engine_details/architecture/object_class.html#general-definition

Example in question - passes MyReference (different class) instead of MyRefCounted to GDCLASS

class MyRefCounted: public RefCounted {
  GDCLASS(MyReference, RefCounted);
};

https://docs.godotengine.org/en/latest/engine_details/architecture/object_class.html#refcounted-memory-management

@bclewi
bclewi requested review from a team as code owners August 1, 2026 22:32
@Mickeon Mickeon added area:engine details Issues and PRs related to the Engine Details section of the documentation bug labels Aug 1, 2026

@Mickeon Mickeon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're not missing anything. Reference is the equivalent class in Godot 3.x before it was renamed.

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

Labels

area:engine details Issues and PRs related to the Engine Details section of the documentation bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants