浏览代码

Merge pull request #10701 from hpvb/fix-callback-crash

Fix a crash in gdscript callbacks
Rémi Verschelde 8 年之前
父节点
当前提交
909c9e0ba0
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      modules/gdscript/gd_function.cpp

+ 2 - 2
modules/gdscript/gd_function.cpp

@@ -1418,7 +1418,7 @@ Variant GDFunctionState::_signal_callback(const Variant **p_args, int p_argcount
 	// If the return value is a GDFunctionState reference,
 	// then the function did yield again after resuming.
 	if (ret.is_ref()) {
-		GDFunctionState *gdfs = Object::cast_to<GDFunctionState>((Object *)&ret);
+		GDFunctionState *gdfs = Object::cast_to<GDFunctionState>(ret);
 		if (gdfs && gdfs->function == function)
 			completed = false;
 	}
@@ -1474,7 +1474,7 @@ Variant GDFunctionState::resume(const Variant &p_arg) {
 	// If the return value is a GDFunctionState reference,
 	// then the function did yield again after resuming.
 	if (ret.is_ref()) {
-		GDFunctionState *gdfs = Object::cast_to<GDFunctionState>((Object *)&ret);
+		GDFunctionState *gdfs = Object::cast_to<GDFunctionState>(ret);
 		if (gdfs && gdfs->function == function)
 			completed = false;
 	}