Browse Source

Merge pull request #105486 from beicause/csharp-stringname-alloc-obj-free

C#: Avoid StringName allocation in `GodotObject.Free`
Thaddeus Crews 4 tháng trước cách đây
mục cha
commit
2ddd9be11f
1 tập tin đã thay đổi với 2 bổ sung3 xóa
  1. 2 3
      modules/mono/editor/bindings_generator.cpp

+ 2 - 3
modules/mono/editor/bindings_generator.cpp

@@ -3123,9 +3123,8 @@ Error BindingsGenerator::_generate_cs_method(const BindingsGenerator::TypeInterf
 		if (p_imethod.requires_object_call) {
 			// Fallback to Godot's object.Call(string, params)
 
-			p_output.append(INDENT2 CS_METHOD_CALL "(\"");
-			p_output.append(p_imethod.name);
-			p_output.append("\"");
+			p_output.append(INDENT2 CS_METHOD_CALL "(");
+			p_output.append("MethodName." + p_imethod.proxy_name);
 
 			for (const ArgumentInterface &iarg : p_imethod.arguments) {
 				p_output.append(", ");