Repository: godot
Issue: GDScript 2.0: Memory leaks on static methods
Labels: bug,topic:gdscript

### Tested versions

- NOT reproducible on v4.2.dev1.official.0c2144da9
- NOT reproducible on v4.2.dev2.official.da81ca62a
- reproducible on v4.2.dev3.official.013e8e3af
- reproducible on v4.2.dev4.official.549fcce5f
- reproducible on v4.2.dev6.official.57a6813bb
- reproducible on v4.2.beta1.official.b1371806a
- reproducible on v4.2.beta4.official.93cdacbb0
- reproducible on v4.2.rc1.official.ad72de508
- reproducible on v4.2.stable.official.46dc27791


### System information

Windows 11

### Issue description

I have received a problem report for my plugin about orphaned nodes. 
see → https://github.com/MikeSchulze/gdUnit4/issues/298

I drilled down to the minimal project to reproduce the issue.
The issue is about using static functions to build an object and lead into orphan nodes.
For simple example:
```
class_name Orphan
extends RefCounted


static func success() -> Orphan:
	var result = Orphan.new()
	return result
```
It worked well on all Godot versions until `v4.2.dev2.official.da81ca62a`
I use this static pattern very often to simplify code like a `Result` to transport success/error and metadata, this is a very common pattern.
```
class_name GdUnitResult
extends RefCounted

enum {
	SUCCESS,
	WARN,
	ERROR,
	EMPTY
}

var _state
var _warn_message := ""
var _error_message := ""
var _value :Variant = null


static func empty() -> GdUnitResult:
	var result := GdUnitResult.new()
	result._state = EMPTY
	return result


static func success(p_value :Variant) -> GdUnitResult:
	assert(p_value != null, "The value must not be NULL")
	var result := GdUnitResult.new()
	result._value = p_value
	result._state = SUCCESS
	return result


static func warn(p_warn_message :String, p_value :Variant = null) -> GdUnitResult:
	assert(not p_warn_message.is_empty()) #,"The message must not be empty")
	var result := GdUnitResult.new()
	result._value = p_value
	result._warn_message = p_warn_message
	result._state = WARN
	return result


static func error(p_error_message :String) -> GdUnitResult:
	assert(not p_error_message.is_empty(), "The message must not be empty")
	var result := GdUnitResult.new()
	result._value = null
	result._error_message = p_error_message
	result._state = ERROR
	return result


func is_success() -> bool:
	return _state == SUCCESS


func is_warn() -> bool:
	return _state == WARN


func is_error() -> bool:
	return _state == ERROR


func is_empty() -> bool:
	return _state == EMPTY


func value() -> Variant:
	return _value


func or_else(p_value):
	if not is_success():
		return p_value
	return value()


func error_message() -> String:
	return _error_message


func warn_message() -> String:
	return _warn_message


func _to_string() -> String:
	return str(GdUnitResult.serialize(self))


static func serialize(result :GdUnitResult) -> Dictionary:
	if result == null:
		push_error("Can't serialize a Null object from type GdUnitResult")
	return {
		"state" : result._state,
		"value" : var_to_str(result._value),
		"warn_msg" : result._warn_message,
		"err_msg" : result._error_message
	}


static func deserialize(config :Dictionary) -> GdUnitResult:
	var result := GdUnitResult.new()
	result._value = str_to_var(config.get("value", ""))
	result._warn_message = config.get("warn_msg", null)
	result._error_message = config.get("err_msg", null)
	result._state = config.get("state")
	return result
```






### Steps to reproduce

Use the attached example project.
- open a terminal
- run the editor by arguments `-e --verbose`
- close the editor

the console output
```
D:\development\workspace\bug_orphan>d:\development\Godot_v4.2.1-stable_win64.exe -e --verbose

D:\development\workspace\bug_orphan>Godot Engine v4.2.1.stable.official.b09f793f5 - https://godotengine.org
TextServer: Added interface "Dummy"
TextServer: Added interface "ICU / HarfBuzz / Graphite (Built-in)"
WARNING: GENERAL - Message Id Number: 0 | Message Id Name: Loader Message
        windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files.
        Objects - 1
                Object[0] - VK_OBJECT_TYPE_INSTANCE, Handle 1888354668096
     at: _debug_messenger_callback (drivers/vulkan/vulkan_context.cpp:264)
Vulkan devices:
  #0: NVIDIA NVIDIA GeForce RTX 4070 Ti - Supported, Discrete
Vulkan API 1.3.260 - Forward+ - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce RTX 4070 Ti
Optional extension VK_KHR_incremental_present not found
Optional extension VK_GOOGLE_display_timing not found
- Vulkan Variable Rate Shading supported:
  Pipeline fragment shading rate
  Primitive fragment shading rate
  Attachment fragment shading rate, min texel size: (16, 16), max texel size: (16, 16)
- Vulkan multiview supported:
  max view count: 32
  max instances: 134217727
- Vulkan subgroup:
  size: 32
  min size: 32
  max size: 32
  stages: STAGE_VERTEX, STAGE_TESSELLATION_CONTROL, STAGE_TESSELLATION_EVALUATION, STAGE_GEOMETRY, STAGE_FRAGMENT, STAGE_COMPUTE, STAGE_RAYGEN_KHR, STAGE_ANY_HIT_KHR, STAGE_CLOSEST_HIT_KHR, STAGE_MISS_KHR, STAGE_INTERSECTION_KHR, STAGE_CALLABLE_KHR, STAGE_TASK_NV, STAGE_MESH_NV
  supported ops: FEATURE_BASIC, FEATURE_VOTE, FEATURE_ARITHMETIC, FEATURE_BALLOT, FEATURE_SHUFFLE, FEATURE_SHUFFLE_RELATIVE, FEATURE_CLUSTERED, FEATURE_QUAD, FEATURE_PARTITIONED_NV
  quad operations in all stages
Startup PSO cache (3.7 MiB)
Using "winink" pen tablet driver...
Creating VMA small objects pool for memory type index 1
Shader 'CanvasSdfShaderRD' (group 0) SHA256: ccda596da71a96af6897be3bc63633145694ec79105c5674ee719a025f168249
Shader 'SkeletonShaderRD' (group 0) SHA256: db547e2a7abfceddca6daece649af33b18189dc08eaa37cef9dc5860862b91ee
Shader 'SortShaderRD' (group 0) SHA256: 0635218ab1b23b93c0e100ad9a6fe7be993089593c96fb6f498e0f9d047ce9f4
Shader 'ParticlesShaderRD' (group 0) SHA256: bfea0e55dd78696fd416c3513873f5a94bc956c2a61b8292eb5d078690e41591
Shader 'ParticlesCopyShaderRD' (group 0) SHA256: b640b70d21ec3903c8e257f1d54ef3c64236018b36feffb7a955f8cbf2b977c4
Shader 'CanvasShaderRD' (group 0) SHA256: f2af9ca0e26c0e8049ed431865d8fd5d14faf79f1ba8dade11df8dbd611652c3
Shader 'CanvasOcclusionShaderRD' (group 0) SHA256: 6e1f14f7d04af941e1d2300431ef37d7e2742684dce4fbe7495def98a3b1cb4d
Shader 'ClusterRenderShaderRD' (group 0) SHA256: 2135e66bae082ab8c6b6d9b8513777bd4aae70f47ed40a170cc241c0696d57dd
Shader 'ClusterStoreShaderRD' (group 0) SHA256: e7c19c07bf7cf7209e469a9fbb06d30b27bf29d7ad91bc47e74e0631765b2d86
Shader 'ClusterDebugShaderRD' (group 0) SHA256: 96afdc9dc3999abd6dc9e98643b3d58644ec856e4fa4ea20f9f69e1b225d6af8
Shader 'SceneForwardClusteredShaderRD' (group 0) SHA256: d5ded1b6d087f9d205de57ed54272037445fd80bbbab48e31e53a3fe33da0710
Shader 'SceneForwardClusteredShaderRD' (group 1) SHA256: 48092b10c0c4dd4c2e716f8fc6f699428872bad85dd07c65b7903c8732acba2a
Shader 'SceneForwardClusteredShaderRD' (group 2) SHA256: 5878195f2ab9a62223312633ac117c7b61974128c353968d1e66c80efb298e03
Shader 'SceneForwardClusteredShaderRD' (group 3) SHA256: 13816f69baf68044a6820cb07e9d2c069d84975407c2560320b8a551545e42cb
Shader 'ResolveShaderRD' (group 0) SHA256: bbae2281243fdb9a2fc1e014df1debab098cfa3fcafe9ee75283d37df2d1fddf
Shader 'TaaResolveShaderRD' (group 0) SHA256: 75850220cf4a882155831df3c46894bb18d5c770308ec844ff00d09520802a9b
Shader 'Fsr2DepthClipPassShaderRD' (group 0) SHA256: 2830090de5d5209b66e51f2bab8566480a2115c0f1b50534f9a18ac00b9be4bd
Shader 'Fsr2ReconstructPreviousDepthPassShaderRD' (group 0) SHA256: 50cb1c922c840f610233f20009f23a81457ee61a0e4986a85e5c08a63ef7c6cf
Shader 'Fsr2LockPassShaderRD' (group 0) SHA256: d6dbbf3057a3df42cf35700040550925b590fa22b318da4e9dde695a9c9601bd
Shader 'Fsr2AccumulatePassShaderRD' (group 0) SHA256: 22be82431e6f4ca678118ab070b427f8ab2bac9cf229056893e06dbcf9b88115
Shader 'Fsr2RcasPassShaderRD' (group 0) SHA256: 618153e882d42170c18f28a260da6d5c589acded5900975af70585065a59e085
Shader 'Fsr2ComputeLuminancePyramidPassShaderRD' (group 0) SHA256: 9dcae72fdad619f6b0b4df518e764e82400773504dc6dc42dee94342522a2cb6
Shader 'Fsr2AutogenReactivePassShaderRD' (group 0) SHA256: 309b444059a2b40ba093bf12cc4b01b327ea377105f38fd3c9b62395b068c3e0
Shader 'Fsr2TcrAutogenPassShaderRD' (group 0) SHA256: c0cd163bbfd61c6a3eb0b3dd9ce53a8191ed96d9c49f766122816258c829426a
Shader 'SsEffectsDownsampleShaderRD' (group 0) SHA256: 33191663db775b3239324c8e7c70b322003c7ba4f3bf509584e1cdc8ce90ca14
Shader 'SsilShaderRD' (group 0) SHA256: 7fd8e5f50a5704489ee2a7c2a433125ad7fa0d3a259d399af638bce1edcb8450
Shader 'SsilImportanceMapShaderRD' (group 0) SHA256: 673bf3ed83df4540ff07c5b6592d8117847d322f44fc54c541a41052868672ad
Shader 'SsilBlurShaderRD' (group 0) SHA256: c4823d0e827d0dd34f66eeeb04a52753c801e7a782e63057003523827a7ebfac
Shader 'SsilInterleaveShaderRD' (group 0) SHA256: 18f771bd553cb304db576babd51d4c4cc63df20ac2052fb0e4133f9fbdf5aa3e
Shader 'SsaoShaderRD' (group 0) SHA256: 21e4ef08ca2c349ce5ab040c40233a23516ece7c756639d914d6617b909985b7
Shader 'SsaoImportanceMapShaderRD' (group 0) SHA256: fc0834566ddf20cc312e6a1eafc6e4ead6ebc5874b1beec4f8b7100879adf9b9
Shader 'SsaoBlurShaderRD' (group 0) SHA256: 6649d2399f3866ffbde70be4eae7644fbfe70907923fd36a10552342f768b48d
Shader 'SsaoInterleaveShaderRD' (group 0) SHA256: 1420d433267675277657dbe4a189eb1a8ee79b1dfbd47038e6acf926e1b3b91b
Shader 'ScreenSpaceReflectionScaleShaderRD' (group 0) SHA256: c17a8a99b2bfaf1a0e3fdeaf2afc912e685a8f581ca9ad3208b2637c78d43699
Shader 'ScreenSpaceReflectionShaderRD' (group 0) SHA256: b5d41ffd66ed21e4cb5bb10d7d6c9f1b2575907979e8577ecaadc91765c64733
Shader 'ScreenSpaceReflectionFilterShaderRD' (group 0) SHA256: 60f8b0befc8ae01c09adc3d4b34f7900bc1430b089054913d923605e7a0ca9c4
Shader 'SubsurfaceScatteringShaderRD' (group 0) SHA256: 91e1ac945dad61f48411d0a1244e6636634e9785333c014ac318fcee04b72741
Shader 'SkyShaderRD' (group 0) SHA256: c773b40a48cb349a2f34006aace7b0ef1aaa8fad530160990a9634fcf019aebe
Shader 'VoxelGiShaderRD' (group 0) SHA256: 26adaa157a0dbc77aaeb10cd9840a3cfeddb4699002202c4069ea0aca1b684eb
Shader 'VoxelGiDebugShaderRD' (group 0) SHA256: 10e6f56ab62c32c6283301052f7f3efd8733a2dd8c54b5c8e8875b4019be3530
Shader 'SdfgiPreprocessShaderRD' (group 0) SHA256: 5d3bf192407ce0131d8d17e264d302c13eb17f8284e643e96071c3c2f09b45a8
Shader 'SdfgiDirectLightShaderRD' (group 0) SHA256: 2d9e0cdb42a45dcec8d6fa71bc0e820405887a0f06b540f9cfb9a3d5b0d05c53
Shader 'SdfgiIntegrateShaderRD' (group 0) SHA256: 15a2e64db17d8aafc8f3d8d2a528747c64d294e8034e7b9e4e86e5ee994d66c2
Shader 'GiShaderRD' (group 0) SHA256: fc70dbaf4b894ea97a0300ec38724bb52936be2bd53a8e3d056f28d9938a1c87
Shader 'SdfgiDebugShaderRD' (group 0) SHA256: 1d7fbd21ccb6e9825acc51d893c06bb4030178286b008b840821fd317fc5302b
Shader 'SdfgiDebugProbesShaderRD' (group 0) SHA256: 90121919d39f8150a9149d5e7eca75d0f2b06d679f544f696bdb941a6cf51810
Shader 'VolumetricFogShaderRD' (group 0) SHA256: c6ff2f4ac52f1179cd0f6c29737304d12ed6b90feae4187f34b38d5228ae1765
Shader 'VolumetricFogProcessShaderRD' (group 0) SHA256: 8d17101913be2888afe1d04fa9287ce1137a8385e86202f4b2a3c6946d3d8982
Shader 'BokehDofShaderRD' (group 0) SHA256: c8b02e9d9aed942a821d35f533288d4fd0a2faaf2c7b58b53c8a92c6c3544feb
Shader 'CopyShaderRD' (group 0) SHA256: b3d9672c50ef509a18599d840e170b4531f88fdffb8f3b73d085bf572599743d
Shader 'CopyToFbShaderRD' (group 0) SHA256: 100799ce54eea0950d2a761842afbdb825c4274cd7ae712042a99dd1738b306b
Shader 'CubeToDpShaderRD' (group 0) SHA256: 660d8fbdedf9d936fc5b9136a097854da9e921113edfdd404a556bcd4fad6f8a
Shader 'CubemapDownsamplerShaderRD' (group 0) SHA256: 7fa47c7b9bdb49d907907d1270a1c655307ed89c6d440c039a74c00a0f65519e
Shader 'CubemapFilterShaderRD' (group 0) SHA256: 1f5612e43bd985ba7545d1f652d72bb4a8251a8320475ebca00f62518d75f98b
Shader 'CubemapRoughnessShaderRD' (group 0) SHA256: 10ad3612c713073a9477ce1395ccb37e510a332370ed0c0a810e1a066533c13a
Shader 'SpecularMergeShaderRD' (group 0) SHA256: fee8ef8ea7ed18eeeebcfa2a626d54c6a503d5b75a9d775d7fb17a7e2dddc698
Shader 'ShadowFrustumShaderRD' (group 0) SHA256: 12fb0f35abe27d7c2578b5bdeaf4517d45f710f9b66ab66f57794d77f90c2fd5
Shader 'MotionVectorsShaderRD' (group 0) SHA256: ca45f570f7b085fd508662270a09a17e42436227dd37e8f5a22034bbb70d8a94
Shader 'LuminanceReduceShaderRD' (group 0) SHA256: ad94b0824e25b988f4792cd9be4cb80f042918016d83b4d9683034bbeffdd811
Shader 'TonemapShaderRD' (group 0) SHA256: 886811888c9b1fc45eecfdd383f8c7087ea62f74178fadb6ff561a568aade71b
Shader 'VrsShaderRD' (group 0) SHA256: b747acdb722b2faf724266877a5336a0141453c1632b280cdff87b47c108f7c9
Shader 'FsrUpscaleShaderRD' (group 0) SHA256: 5d97f0e27e6b49e530b561b06452e04bbf6b4763e0b831ea8650c098644f446a
Shader 'BlitShaderRD' (group 0) SHA256: 72c6e59fbd6bdca88a055003cd3614ebdbc4b9fed5efefb796128c188d379986
WASAPI: Activated output_device using IAudioClient3 interface
WASAPI: wFormatTag = 65534
WASAPI: nChannels = 2
WASAPI: nSamplesPerSec = 48000
WASAPI: nAvgBytesPerSec = 384000
WASAPI: nBlockAlign = 8
WASAPI: wBitsPerSample = 32
WASAPI: cbSize = 22
WASAPI: mix_rate = 48000
WASAPI: fundamental_period_frames = 480
WASAPI: min_period_frames = 480
WASAPI: max_period_frames = 480
WASAPI: selected a period frame size of 480
WASAPI: detected 2 channels
WASAPI: audio buffer frames: 480 calculated latency: 10ms

TextServer: Primary interface set to: "ICU / HarfBuzz / Graphite (Built-in)".
CORE API HASH: 915626997
EDITOR API HASH: 1313472085
EditorSettings: Load OK!
WARNING: Der Blend-Dateiimport ist in den Projekteinstellungen aktiviert, aber es wurde kein Blender-Pfad in den Editoreinstellungen festgelegt. Es werden keine Blend-Dateien importiert.
     at: _editor_init (modules/gltf/register_types.cpp:63)
Loaded system CA certificates
Creating VMA small objects pool for memory type index 3
EditorSettings: Save OK!
Loading GdUnit4 Plugin success
Regenerating editor help cache
Class 'AbstractPolygon2DEditor' is not exposed, skipping.
Class 'AbstractPolygon2DEditorPlugin' is not exposed, skipping.
Class 'ActionMapEditor' is not exposed, skipping.
Class 'AnchorPresetPicker' is not exposed, skipping.
Class 'AnimationBezierTrackEdit' is not exposed, skipping.
Class 'AnimationLibraryEditor' is not exposed, skipping.
Class 'AnimationNodeBlendSpace1DEditor' is not exposed, skipping.
Class 'AnimationNodeBlendSpace2DEditor' is not exposed, skipping.
Class 'AnimationNodeBlendTreeEditor' is not exposed, skipping.
Class 'AnimationNodeStateMachineEditor' is not exposed, skipping.
Class 'AnimationPlayerEditor' is not exposed, skipping.
Class 'AnimationPlayerEditorPlugin' is not exposed, skipping.
Class 'AnimationTimelineEdit' is not exposed, skipping.
Class 'AnimationTrackEditDefaultPlugin' is not exposed, skipping.
Class 'AnimationTrackEditPlugin' is not exposed, skipping.
Class 'AnimationTrackEditor' is not exposed, skipping.
Class 'AnimationTrackKeyEditEditorPlugin' is not exposed, skipping.
Class 'AnimationTreeEditor' is not exposed, skipping.
Class 'AnimationTreeEditorPlugin' is not exposed, skipping.
Class 'AnimationTreeNodeEditorPlugin' is not exposed, skipping.
Class 'AssetLibraryEditorPlugin' is not exposed, skipping.
Class 'AtlasMergingDialog' is not exposed, skipping.
Class 'AtlasTileProxyObject' is not exposed, skipping.
Class 'AudioBusesEditorPlugin' is not exposed, skipping.
Class 'AudioListener3DGizmoPlugin' is not exposed, skipping.
Class 'AudioStreamEditorPlugin' is not exposed, skipping.
Class 'AudioStreamImportSettings' is not exposed, skipping.
Class 'AudioStreamPlayer3DGizmoPlugin' is not exposed, skipping.
Class 'AudioStreamPreviewGenerator' is not exposed, skipping.
Class 'AudioStreamRandomizerEditorPlugin' is not exposed, skipping.
Class 'BackgroundProgress' is not exposed, skipping.
Class 'BitMapEditorPlugin' is not exposed, skipping.
Class 'BoneMapEditorPlugin' is not exposed, skipping.
Class 'CPUParticles2DEditorPlugin' is not exposed, skipping.
Class 'CPUParticles3DEditor' is not exposed, skipping.
Class 'CPUParticles3DEditorPlugin' is not exposed, skipping.
Class 'CPUParticles3DGizmoPlugin' is not exposed, skipping.
Class 'CSGShape3DGizmoPlugin' is not exposed, skipping.
Class 'Camera3DEditorPlugin' is not exposed, skipping.
Class 'Camera3DGizmoPlugin' is not exposed, skipping.
Class 'CanvasItemEditor' is not exposed, skipping.
Class 'CanvasItemEditorPlugin' is not exposed, skipping.
Class 'CanvasItemEditorViewport' is not exposed, skipping.
Class 'CanvasItemMaterialConversionPlugin' is not exposed, skipping.
Class 'Cast2DEditor' is not exposed, skipping.
Class 'Cast2DEditorPlugin' is not exposed, skipping.
Class 'CollisionObject3DGizmoPlugin' is not exposed, skipping.
Class 'CollisionPolygon2DEditor' is not exposed, skipping.
Class 'CollisionPolygon2DEditorPlugin' is not exposed, skipping.
Class 'CollisionPolygon3DGizmoPlugin' is not exposed, skipping.
Class 'CollisionShape2DEditor' is not exposed, skipping.
Class 'CollisionShape2DEditorPlugin' is not exposed, skipping.
Class 'CollisionShape3DGizmoPlugin' is not exposed, skipping.
Class 'ConnectDialog' is not exposed, skipping.
Class 'ConnectDialogBinds' is not exposed, skipping.
Class 'ConnectionsDock' is not exposed, skipping.
Class 'ControlEditorPlugin' is not exposed, skipping.
Class 'ControlEditorPopupButton' is not exposed, skipping.
Class 'ControlEditorPresetPicker' is not exposed, skipping.
Class 'ControlEditorToolbar' is not exposed, skipping.
Class 'CreateDialog' is not exposed, skipping.
Class 'CurveEditorPlugin' is not exposed, skipping.
Class 'CurvePreviewGenerator' is not exposed, skipping.
Class 'DebugAdapterParser' is not exposed, skipping.
Class 'DebugAdapterServer' is not exposed, skipping.
Class 'DebuggerEditorPlugin' is not exposed, skipping.
Class 'DecalGizmoPlugin' is not exposed, skipping.
Class 'DefaultThemeEditorPreview' is not exposed, skipping.
Class 'DependencyEditor' is not exposed, skipping.
Class 'DependencyEditorOwners' is not exposed, skipping.
Class 'DependencyErrorDialog' is not exposed, skipping.
Class 'DependencyRemoveDialog' is not exposed, skipping.
Class 'DirectoryCreateDialog' is not exposed, skipping.
Class 'DynamicFontImportSettings' is not exposed, skipping.
Class 'DynamicFontImportSettingsData' is not exposed, skipping.
Class 'EditorAbout' is not exposed, skipping.
Class 'EditorAssetLibrary' is not exposed, skipping.
Class 'EditorAudioBus' is not exposed, skipping.
Class 'EditorAudioBuses' is not exposed, skipping.
Class 'EditorAudioMeterNotches' is not exposed, skipping.
Class 'EditorAudioStreamPreviewPlugin' is not exposed, skipping.
Class 'EditorAutoloadSettings' is not exposed, skipping.
Class 'EditorBitmapPreviewPlugin' is not exposed, skipping.
Class 'EditorBuildProfile' is not exposed, skipping.
Class 'EditorBuildProfileManager' is not exposed, skipping.
Class 'EditorDebuggerInspector' is not exposed, skipping.
Class 'EditorDebuggerNode' is not exposed, skipping.
Class 'EditorDebuggerRemoteObject' is not exposed, skipping.
Class 'EditorDebuggerTree' is not exposed, skipping.
Class 'EditorDirDialog' is not exposed, skipping.
Class 'EditorExport' is not exposed, skipping.
Class 'EditorExportGDScript' is not exposed, skipping.
Class 'EditorFeatureProfileManager' is not exposed, skipping.
Class 'EditorFileServer' is not exposed, skipping.
Class 'EditorFileSystemImportFormatSupportQueryFBX' is not exposed, skipping.
Class 'EditorFontPreviewPlugin' is not exposed, skipping.
Class 'EditorGradientPreviewPlugin' is not exposed, skipping.
Class 'EditorHelpBit' is not exposed, skipping.
Class 'EditorHelpSearch' is not exposed, skipping.
Class 'EditorImagePreviewPlugin' is not exposed, skipping.
Class 'EditorImportBlendRunner' is not exposed, skipping.
Class 'EditorInspectorCategory' is not exposed, skipping.
Class 'EditorInspectorDefaultPlugin' is not exposed, skipping.
Class 'EditorInspectorPlugin3DTexture' is not exposed, skipping.
Class 'EditorInspectorPluginAnimationTrackKeyEdit' is not exposed, skipping.
Class 'EditorInspectorPluginAudioStream' is not exposed, skipping.
Class 'EditorInspectorPluginBitMap' is not exposed, skipping.
Class 'EditorInspectorPluginBoneMap' is not exposed, skipping.
Class 'EditorInspectorPluginControl' is not exposed, skipping.
Class 'EditorInspectorPluginCurve' is not exposed, skipping.
Class 'EditorInspectorPluginFontPreview' is not exposed, skipping.
Class 'EditorInspectorPluginFontVariation' is not exposed, skipping.
Class 'EditorInspectorPluginGradient' is not exposed, skipping.
Class 'EditorInspectorPluginGradientTexture2D' is not exposed, skipping.
Class 'EditorInspectorPluginInputEvent' is not exposed, skipping.
Class 'EditorInspectorPluginLayeredTexture' is not exposed, skipping.
Class 'EditorInspectorPluginMaterial' is not exposed, skipping.
Class 'EditorInspectorPluginMesh' is not exposed, skipping.
Class 'EditorInspectorPluginPackedScene' is not exposed, skipping.
Class 'EditorInspectorPluginSkeleton' is not exposed, skipping.
Class 'EditorInspectorPluginStyleBox' is not exposed, skipping.
Class 'EditorInspectorPluginSubViewportPreview' is not exposed, skipping.
Class 'EditorInspectorPluginSystemFont' is not exposed, skipping.
Class 'EditorInspectorPluginTexture' is not exposed, skipping.
Class 'EditorInspectorPluginTextureRegion' is not exposed, skipping.
Class 'EditorInspectorPluginTileData' is not exposed, skipping.
Class 'EditorInspectorRootMotionPlugin' is not exposed, skipping.
Class 'EditorInspectorVisualShaderModePlugin' is not exposed, skipping.
Class 'EditorJSONSyntaxHighlighter' is not exposed, skipping.
Class 'EditorLayoutsDialog' is not exposed, skipping.
Class 'EditorLocaleDialog' is not exposed, skipping.
Class 'EditorLog' is not exposed, skipping.
Class 'EditorMaterialPreviewPlugin' is not exposed, skipping.
Class 'EditorMeshPreviewPlugin' is not exposed, skipping.
Class 'EditorNativeShaderSourceVisualizer' is not exposed, skipping.
Class 'EditorNetworkProfiler' is not exposed, skipping.
Class 'EditorNode' is not exposed, skipping.
Class 'EditorOBJImporter' is not exposed, skipping.
Class 'EditorObjectSelector' is not exposed, skipping.
Class 'EditorPackedScenePreviewPlugin' is not exposed, skipping.
Class 'EditorPerformanceProfiler' is not exposed, skipping.
Class 'EditorPluginCSG' is not exposed, skipping.
Class 'EditorPluginSettings' is not exposed, skipping.
Class 'EditorProfiler' is not exposed, skipping.
Class 'EditorPropertyCheck' is not exposed, skipping.
Class 'EditorPropertyDictionaryObject' is not exposed, skipping.
Class 'EditorPropertyInteger' is not exposed, skipping.
Class 'EditorPropertyLocalizableString' is not exposed, skipping.
Class 'EditorPropertyMultilineText' is not exposed, skipping.
Class 'EditorPropertyNameProcessor' is not exposed, skipping.
Class 'EditorPropertyPath' is not exposed, skipping.
Class 'EditorPropertyResource' is not exposed, skipping.
Class 'EditorPropertyText' is not exposed, skipping.
Class 'EditorPropertyVector2i' is not exposed, skipping.
Class 'EditorPropertyVectorN' is not exposed, skipping.
Class 'EditorQuickOpen' is not exposed, skipping.
Class 'EditorRunBar' is not exposed, skipping.
Class 'EditorRunNative' is not exposed, skipping.
Class 'EditorSceneFormatImporterCollada' is not exposed, skipping.
Class 'EditorSceneFormatImporterESCN' is not exposed, skipping.
Class 'EditorSceneTabs' is not exposed, skipping.
Class 'EditorScriptPreviewPlugin' is not exposed, skipping.
Class 'EditorSettingsDialog' is not exposed, skipping.
Class 'EditorTexturePreviewPlugin' is not exposed, skipping.
Class 'EditorTextureTooltipPlugin' is not exposed, skipping.
Class 'EditorTheme' is not exposed, skipping.
Class 'EditorTitleBar' is not exposed, skipping.
Class 'EditorToaster' is not exposed, skipping.
Class 'EditorValidationPanel' is not exposed, skipping.
Class 'EditorVisualProfiler' is not exposed, skipping.
Class 'EditorZoomWidget' is not exposed, skipping.
Class 'EventListenerLineEdit' is not exposed, skipping.
Class 'ExportTemplateManager' is not exposed, skipping.
Class 'FBXImporterManager' is not exposed, skipping.
Class 'FileSystemList' is not exposed, skipping.
Class 'FindInFiles' is not exposed, skipping.
Class 'FindInFilesDialog' is not exposed, skipping.
Class 'FindInFilesPanel' is not exposed, skipping.
Class 'FindReplaceBar' is not exposed, skipping.
Class 'FogMaterialConversionPlugin' is not exposed, skipping.
Class 'FogVolumeGizmoPlugin' is not exposed, skipping.
Class 'FontEditorPlugin' is not exposed, skipping.
Class 'FramebufferCacheRD' is not exposed, skipping.
Class 'GDScriptEditorTranslationParserPlugin' is not exposed, skipping.
Class 'GDScriptLanguageServer' is not exposed, skipping.
Class 'GDScriptNativeClass' is not exposed, skipping.
Class 'GDScriptSyntaxHighlighter' is not exposed, skipping.
Class 'GLTFDocumentExtensionPhysics' is not exposed, skipping.
Class 'GLTFDocumentExtensionTextureKTX' is not exposed, skipping.
Class 'GLTFDocumentExtensionTextureWebP' is not exposed, skipping.
Class 'GPUParticles2DEditorPlugin' is not exposed, skipping.
Class 'GPUParticles3DEditor' is not exposed, skipping.
Class 'GPUParticles3DEditorBase' is not exposed, skipping.
Class 'GPUParticles3DEditorPlugin' is not exposed, skipping.
Class 'GPUParticles3DGizmoPlugin' is not exposed, skipping.
Class 'GPUParticlesCollision3DGizmoPlugin' is not exposed, skipping.
Class 'GPUParticlesCollisionSDF3DEditorPlugin' is not exposed, skipping.
Class 'Gizmo3DHelper' is not exposed, skipping.
Class 'GodotNavigationServer2D' is not exposed, skipping.
Class 'GodotPhysicsDirectSpaceState2D' is not exposed, skipping.
Class 'GodotPhysicsServer2D' is not exposed, skipping.
Class 'GodotPhysicsServer3D' is not exposed, skipping.
Class 'GradientEditorPlugin' is not exposed, skipping.
Class 'GradientTexture2DEditorPlugin' is not exposed, skipping.
Class 'GraphEditFilter' is not exposed, skipping.
Class 'GraphEditMinimap' is not exposed, skipping.
Class 'GridMapEditor' is not exposed, skipping.
Class 'GridMapEditorPlugin' is not exposed, skipping.
Class 'GroupDialog' is not exposed, skipping.
Class 'GroupsEditor' is not exposed, skipping.
Class 'HistoryDock' is not exposed, skipping.
Class 'IPUnix' is not exposed, skipping.
Class 'ImportDefaultsEditor' is not exposed, skipping.
Class 'ImportDefaultsEditorSettings' is not exposed, skipping.
Class 'ImportDock' is not exposed, skipping.
Class 'ImportDockParameters' is not exposed, skipping.
Class 'InputEventConfigurationDialog' is not exposed, skipping.
Class 'InputEventEditorPlugin' is not exposed, skipping.
Class 'InspectorDock' is not exposed, skipping.
Class 'Joint3DGizmoPlugin' is not exposed, skipping.
Class 'Label3DGizmoPlugin' is not exposed, skipping.
Class 'Light3DGizmoPlugin' is not exposed, skipping.
Class 'LightOccluder2DEditor' is not exposed, skipping.
Class 'LightOccluder2DEditorPlugin' is not exposed, skipping.
Class 'LightmapGIEditorPlugin' is not exposed, skipping.
Class 'LightmapGIGizmoPlugin' is not exposed, skipping.
Class 'LightmapProbeGizmoPlugin' is not exposed, skipping.
Class 'Line2DEditor' is not exposed, skipping.
Class 'Line2DEditorPlugin' is not exposed, skipping.
Class 'LocalizationEditor' is not exposed, skipping.
Class 'Marker3DGizmoPlugin' is not exposed, skipping.
Class 'MaterialEditorPlugin' is not exposed, skipping.
Class 'MeshEditorPlugin' is not exposed, skipping.
Class 'MeshInstance3DEditor' is not exposed, skipping.
Class 'MeshInstance3DEditorPlugin' is not exposed, skipping.
Class 'MeshInstance3DGizmoPlugin' is not exposed, skipping.
Class 'MeshLibraryEditor' is not exposed, skipping.
Class 'MeshLibraryEditorPlugin' is not exposed, skipping.
Class 'MovieWriterMJPEG' is not exposed, skipping.
Class 'MovieWriterPNGWAV' is not exposed, skipping.
Class 'MultiMeshEditor' is not exposed, skipping.
Class 'MultiMeshEditorPlugin' is not exposed, skipping.
Class 'MultiplayerEditorDebugger' is not exposed, skipping.
Class 'MultiplayerEditorPlugin' is not exposed, skipping.
Class 'NavigationLink2DEditor' is not exposed, skipping.
Class 'NavigationLink2DEditorPlugin' is not exposed, skipping.
Class 'NavigationLink3DGizmoPlugin' is not exposed, skipping.
Class 'NavigationMeshEditor' is not exposed, skipping.
Class 'NavigationMeshEditorPlugin' is not exposed, skipping.
Class 'NavigationObstacle2DEditor' is not exposed, skipping.
Class 'NavigationObstacle2DEditorPlugin' is not exposed, skipping.
Class 'NavigationObstacle3DEditor' is not exposed, skipping.
Class 'NavigationObstacle3DEditorPlugin' is not exposed, skipping.
Class 'NavigationPolygonEditor' is not exposed, skipping.
Class 'NavigationPolygonEditorPlugin' is not exposed, skipping.
Class 'NavigationRegion3DGizmoPlugin' is not exposed, skipping.
Class 'Node3DEditor' is not exposed, skipping.
Class 'Node3DEditorPlugin' is not exposed, skipping.
Class 'Node3DEditorViewport' is not exposed, skipping.
Class 'Node3DEditorViewportContainer' is not exposed, skipping.
Class 'NodeDock' is not exposed, skipping.
Class 'NoiseEditorInspectorPlugin' is not exposed, skipping.
Class 'NoiseEditorPlugin' is not exposed, skipping.
Class 'ORMMaterial3DConversionPlugin' is not exposed, skipping.
Class 'OccluderInstance3DEditorPlugin' is not exposed, skipping.
Class 'OccluderInstance3DGizmoPlugin' is not exposed, skipping.
Class 'OrphanResourcesDialog' is not exposed, skipping.
Class 'PackedSceneEditorPlugin' is not exposed, skipping.
Class 'PackedSceneEditorTranslationParserPlugin' is not exposed, skipping.
Class 'PanoramaSkyMaterialConversionPlugin' is not exposed, skipping.
Class 'ParticleProcessMaterialConversionPlugin' is not exposed, skipping.
Class 'Path2DEditor' is not exposed, skipping.
Class 'Path2DEditorPlugin' is not exposed, skipping.
Class 'Path3DEditorPlugin' is not exposed, skipping.
Class 'Path3DGizmoPlugin' is not exposed, skipping.
Class 'PhysicalBone3DEditorPlugin' is not exposed, skipping.
Class 'PhysicalBone3DGizmoPlugin' is not exposed, skipping.
Class 'PhysicalSkyMaterialConversionPlugin' is not exposed, skipping.
Class 'PluginConfigDialog' is not exposed, skipping.
Class 'Polygon2DEditor' is not exposed, skipping.
Class 'Polygon2DEditorPlugin' is not exposed, skipping.
Class 'Polygon3DEditor' is not exposed, skipping.
Class 'Polygon3DEditorPlugin' is not exposed, skipping.
Class 'PostImportPluginSkeletonRenamer' is not exposed, skipping.
Class 'PostImportPluginSkeletonRestFixer' is not exposed, skipping.
Class 'PostImportPluginSkeletonTrackOrganizer' is not exposed, skipping.
Class 'ProceduralSkyMaterialConversionPlugin' is not exposed, skipping.
Class 'ProgressDialog' is not exposed, skipping.
Class 'ProjectExportDialog' is not exposed, skipping.
Class 'ProjectExportTextureFormatError' is not exposed, skipping.
Class 'ProjectSettingsEditor' is not exposed, skipping.
Class 'PropertySelector' is not exposed, skipping.
Class 'RayCast3DGizmoPlugin' is not exposed, skipping.
Class 'ReflectionProbeGizmoPlugin' is not exposed, skipping.
Class 'RenameDialog' is not exposed, skipping.
Class 'ReparentDialog' is not exposed, skipping.
Class 'ReplicationEditor' is not exposed, skipping.
Class 'ResourceFormatImporterSaver' is not exposed, skipping.
Class 'ResourcePreloaderEditor' is not exposed, skipping.
Class 'ResourcePreloaderEditorPlugin' is not exposed, skipping.
Class 'SceneCacheInterface' is not exposed, skipping.
Class 'SceneCreateDialog' is not exposed, skipping.
Class 'SceneExporterGLTFPlugin' is not exposed, skipping.
Class 'SceneImportSettings' is not exposed, skipping.
Class 'SceneImportSettingsData' is not exposed, skipping.
Class 'SceneRPCInterface' is not exposed, skipping.
Class 'SceneReplicationInterface' is not exposed, skipping.
Class 'SceneTileProxyObject' is not exposed, skipping.
Class 'SceneTreeDialog' is not exposed, skipping.
Class 'SceneTreeDock' is not exposed, skipping.
Class 'SceneTreeEditor' is not exposed, skipping.
Class 'ScreenSelect' is not exposed, skipping.
Class 'ScriptEditorDebugger' is not exposed, skipping.
Class 'ScriptEditorPlugin' is not exposed, skipping.
Class 'SectionedInspector' is not exposed, skipping.
Class 'SectionedInspectorFilter' is not exposed, skipping.
Class 'ShaderCreateDialog' is not exposed, skipping.
Class 'ShaderEditorPlugin' is not exposed, skipping.
Class 'ShaderFileEditor' is not exposed, skipping.
Class 'ShaderFileEditorPlugin' is not exposed, skipping.
Class 'ShaderGlobalsEditor' is not exposed, skipping.
Class 'ShaderGlobalsEditorInterface' is not exposed, skipping.
Class 'ShapeCast3DGizmoPlugin' is not exposed, skipping.
Class 'ShortcutBin' is not exposed, skipping.
Class 'SizeFlagPresetPicker' is not exposed, skipping.
Class 'Skeleton2DEditor' is not exposed, skipping.
Class 'Skeleton2DEditorPlugin' is not exposed, skipping.
Class 'Skeleton3DEditorPlugin' is not exposed, skipping.
Class 'Skeleton3DGizmoPlugin' is not exposed, skipping.
Class 'SkeletonIK3DEditorPlugin' is not exposed, skipping.
Class 'SnapDialog' is not exposed, skipping.
Class 'SoftBody3DGizmoPlugin' is not exposed, skipping.
Class 'SplitContainerDragger' is not exposed, skipping.
Class 'SpringArm3DGizmoPlugin' is not exposed, skipping.
Class 'Sprite2DEditor' is not exposed, skipping.
Class 'Sprite2DEditorPlugin' is not exposed, skipping.
Class 'SpriteBase3DGizmoPlugin' is not exposed, skipping.
Class 'SpriteFramesEditor' is not exposed, skipping.
Class 'SpriteFramesEditorPlugin' is not exposed, skipping.
Class 'StandardMaterial3DConversionPlugin' is not exposed, skipping.
Class 'StyleBoxEditorPlugin' is not exposed, skipping.
Class 'SubViewportPreviewEditorPlugin' is not exposed, skipping.
Class 'SurfaceUpgradeDialog' is not exposed, skipping.
Class 'SurfaceUpgradeTool' is not exposed, skipping.
Class 'Texture3DEditorPlugin' is not exposed, skipping.
Class 'TextureEditorPlugin' is not exposed, skipping.
Class 'TextureLayeredEditorPlugin' is not exposed, skipping.
Class 'TextureRegionEditor' is not exposed, skipping.
Class 'TextureRegionEditorPlugin' is not exposed, skipping.
Class 'ThemeContext' is not exposed, skipping.
Class 'ThemeEditor' is not exposed, skipping.
Class 'ThemeEditorPlugin' is not exposed, skipping.
Class 'ThemeEditorPreview' is not exposed, skipping.
Class 'ThemeItemEditorDialog' is not exposed, skipping.
Class 'ThemeItemImportTree' is not exposed, skipping.
Class 'ThemeTypeDialog' is not exposed, skipping.
Class 'ThemeTypeEditor' is not exposed, skipping.
Class 'TileAtlasView' is not exposed, skipping.
Class 'TileMapEditor' is not exposed, skipping.
Class 'TileMapEditorPlugin' is not exposed, skipping.
Class 'TileMapEditorTerrainsPlugin' is not exposed, skipping.
Class 'TileMapEditorTilesPlugin' is not exposed, skipping.
Class 'TileProxiesManagerDialog' is not exposed, skipping.
Class 'TileSetAtlasSourceEditor' is not exposed, skipping.
Class 'TileSetAtlasSourceProxyObject' is not exposed, skipping.
Class 'TileSetEditor' is not exposed, skipping.
Class 'TileSetEditorPlugin' is not exposed, skipping.
Class 'TileSetScenesCollectionProxyObject' is not exposed, skipping.
Class 'TileSetScenesCollectionSourceEditor' is not exposed, skipping.
Class 'TileSourceInspectorPlugin' is not exposed, skipping.
Class 'TilesEditorUtils' is not exposed, skipping.
Class 'TranslationPO' is not exposed, skipping.
Class 'UniformSetCacheRD' is not exposed, skipping.
Class 'VehicleWheel3DGizmoPlugin' is not exposed, skipping.
Class 'VersionControlEditorPlugin' is not exposed, skipping.
Class 'ViewPanner' is not exposed, skipping.
Class 'ViewportNavigationControl' is not exposed, skipping.
Class 'ViewportRotationControl' is not exposed, skipping.
Class 'VisibleOnScreenNotifier3DGizmoPlugin' is not exposed, skipping.
Class 'VisualShaderConversionPlugin' is not exposed, skipping.
Class 'VoxelGIEditorPlugin' is not exposed, skipping.
Class 'VoxelGIGizmoPlugin' is not exposed, skipping.
Class 'WindowWrapper' is not exposed, skipping.
_exit_tree ->
_exit_tree <-
EditorSettings: Save OK!
XR: Clearing primary interface
XR: Removed interface "Native mobile"
XR: Removed interface "OpenXR"
WARNING: ObjectDB instances leaked at exit (run with --verbose for details).
     at: cleanup (core/object/object.cpp:2208)
Leaked instance: GDScriptNativeClass:-9222843721517628692
Leaked instance: GDScript:-9175100727616281327 - Resource path: res://addons/gdUnit4/src/Orphan.gd
Hint: Leaked instances typically happen when nodes are removed from the scene tree (with `remove_child()`) but not freed (with `free()` or `queue_free()`).
ERROR: Resources still in use at exit (run with --verbose for details).
   at: clear (core/io/resource.cpp:493)
Resource still in use: res://addons/gdUnit4/src/Orphan.gd (GDScript)
Orphan StringName: _setup_local_to_scene (static: 0, total: 1)
Orphan StringName: Orphan (static: 0, total: 3)
Orphan StringName: res://addons/gdUnit4/src/Orphan.gd (static: 0, total: 2)
Orphan StringName: RefCounted (static: 1, total: 3)
Orphan StringName: @implicit_new (static: 0, total: 1)
Orphan StringName: success (static: 0, total: 3)
StringName: 6 unclaimed string names at exit.
```

### Minimal reproduction project (MRP)

[bug_orphan.zip](https://github.com/godotengine/godot/files/13777814/bug_orphan.zip)