Sync classref with changes from godotengine/godot#24640

This commit is contained in:
Rémi Verschelde
2019-01-07 10:14:08 +01:00
parent 4f5d503b25
commit f70354d01c
521 changed files with 27321 additions and 22169 deletions

View File

@@ -19,19 +19,19 @@ Holds an :ref:`Object<class_Object>`, but does not contribute to the reference c
Methods
-------
+--------------------------------+---------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`get_ref<class_WeakRef_get_ref>` **(** **)** const |
+--------------------------------+---------------------------------------------------------+
+-------------------------------+----------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`get_ref<class_WeakRef_method_get_ref>` **(** **)** const |
+-------------------------------+----------------------------------------------------------------+
Description
-----------
A weakref can hold a :ref:`Reference<class_Reference>`, without contributing to the reference counter. A weakref can be created from an :ref:`Object<class_Object>` using :ref:`@GDScript.weakref<class_@GDScript_weakref>`. If this object is not a reference, weakref still works, however, it does not have any effect on the object. Weakrefs are useful in cases where multiple classes have variables that refer to each other. Without weakrefs, using these classes could lead to memory leaks, since both references keep each other from being released. Making part of the variables a weakref can prevent this cyclic dependency, and allows the references to be released.
A weakref can hold a :ref:`Reference<class_Reference>`, without contributing to the reference counter. A weakref can be created from an :ref:`Object<class_Object>` using :ref:`@GDScript.weakref<class_@GDScript_method_weakref>`. If this object is not a reference, weakref still works, however, it does not have any effect on the object. Weakrefs are useful in cases where multiple classes have variables that refer to each other. Without weakrefs, using these classes could lead to memory leaks, since both references keep each other from being released. Making part of the variables a weakref can prevent this cyclic dependency, and allows the references to be released.
Method Descriptions
-------------------
.. _class_WeakRef_get_ref:
.. _class_WeakRef_method_get_ref:
- :ref:`Variant<class_Variant>` **get_ref** **(** **)** const