Skip to content

NOTIFICATION_POSTINITIALIZE doesn't happen when an object is reloaded #1896

@dsnopek

Description

@dsnopek

Godot version

Godot 4.5.1

godot-cpp version

godot-cpp 4.5

System information

Godot v4.5.1.stable - Pop!_OS 22.04 LTS on X11 - X11 display driver, Single-window, 3 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 Ti - AMD Ryzen 9 7950X 16-Core Processor (32 threads) - 61.94 GiB memory

Issue description

Currently, it's memnew() that calls notification(NOTIFICATION_POSTINITIALIZE) on the whole Godot object, which will eventually trickle down to any extension classes that are attached to it.

However, if an object is reloaded, memnew() doesn't happen. In part, this is good, because we don't want the whole Godot object to get NOTIFICATION_POSTINITIALIZE again.

But I think we do want for the instance binding on the godot-cpp side to get NOTIFICATION_POSTINITIALIZE again, because some extension classes may not work right if it doesn't happen.

So, I suspect this is a bug, but I haven't looked into too much yet

(It was @raulsntos who pointed this out to me)

Steps to reproduce

  1. Make a Node in an extension that does something on NOTIFICATION_POSTINITIALIZE
  2. Add this node to a scene in the editor
  3. Rebuild the extension to initiate reload
  4. Notice that it didn't do it's thing on NOTIFICATION_POSTINITIALIZE

Minimal reproduction project

Not yet :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis has been identified as a bug

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions