Skip to content

Object-less callables rejected by Object::connect et al #81887

Closed
@maiself

Description

@maiself

Godot version

master, e3e2528

System information

linux

Issue description

Creating this issue to keep track of something discovered while working working on #79005.

Basically, in some places Godot has checks for object as a way to check if a callable is valid. This seems wrong, especially for custom callables, which may not actually have an associated object. While this doesn't seem to be a problem within the engine itself, it can be a problem for extensions. In my extension I had to use a workaround that creates an object that exists for no reason other than to pass those checks.

Here are some examples of object-less callables being rejected:

I haven't looked to see if there are more cases (I merely searched object.cpp for get_object()).

Original comments from #79005:

Steps to reproduce

N/A

Minimal reproduction project

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions