Skip to content

Memory leak in draw_string example #5825

@TheDuriel

Description

@TheDuriel

Your Godot version:
3.stable

Issue description:
The code example creates an orphan node.

The below is the corrected example which does not leak memory.

var control = Control.new()
var default_font = control.get_font("font")
control.queue_free()
draw_string(default_font, Vector2(64, 64), "Hello world")

URL to the documentation page:
https://docs.godotengine.org/en/stable/classes/class_canvasitem.html#class-canvasitem-method-draw-string

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:class referenceIssues and PRs about the class reference, which should be addressed on the Godot engine repositorybug

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions