You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Dart Available as a Scripting Language | 🟨 | Mostly usable in personal testing |
23
23
| Hot Reload | ✅ | Hot Reload button now included. |
24
24
| Simplified Binding using build_runner | 🟨 | Early implementation |
@@ -267,13 +267,27 @@ position = pos;
267
267
But in my opinion, this defeats the purpose of wrapping properties. Properties
268
268
should mimic public member variables, and, when they can't, use methods instead.
269
269
270
+
# Debugging
271
+
272
+
Because of a change in the Dart SDK, you currently need to run the Dart Dev Service (DDS) in order to debug your game or Dart code in the Godot editor. To do so, with your game running, run the following in a terminal:
`RefCounted` objects in Godot need special handling in garbage collected languages like Dart.
4
+
5
+
Any `RefCounted` object that is refernced by Dart adds one to its reference count, and its Script Instance Binding or Extension Instance Binding holds a handle to the Dart version of the object. However, Dart needs to know if it can safely garbage collect this object and release its reference to the `RefCounted` object, otherwise Dart will hold it forever and the object will leak.
6
+
7
+
What Dart does is use the `referenced` callback of both Script Instance Bindings and Extension Instance Bindings to determine if it is the *only* reference to a `RefCounted`object. If it is, the Godot Dart engine converts its reference to the object to *weak*, which means that if no objects in Dart are referencing it, it can safely be garbage collected. If Dart is not the only reference, the Godot Dart engine changes its reference to *strong* so that even if no Dart objects are referencing the object, Dart doesn't accidentlly garbage collect a handle it needs to remain valid.
8
+
9
+
To help make sense of the logic, here's a diagram:
0 commit comments