You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Better support in ScriptLanguage for GC based scripts
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
#include "reference.h"
|
||||
|
||||
#include "script_language.h"
|
||||
|
||||
|
||||
bool Reference::init_ref() {
|
||||
@@ -66,11 +66,21 @@ int Reference::reference_get_count() const {
|
||||
void Reference::reference(){
|
||||
|
||||
refcount.ref();
|
||||
if (get_script_instance()) {
|
||||
get_script_instance()->refcount_incremented();
|
||||
}
|
||||
|
||||
}
|
||||
bool Reference::unreference(){
|
||||
|
||||
return refcount.unref();
|
||||
bool die = refcount.unref();
|
||||
|
||||
if (get_script_instance()) {
|
||||
die = die && get_script_instance()->refcount_decremented();
|
||||
}
|
||||
|
||||
return die;
|
||||
|
||||
}
|
||||
|
||||
Reference::Reference() {
|
||||
|
||||
Reference in New Issue
Block a user