TscanCode icon indicating copy to clipboard operation
TscanCode copied to clipboard

Mac版本内存泄漏无法检出

Open hanbim520 opened this issue 5 years ago • 1 comments

代码如下,使用mac版本检查: using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine;

public class NewBehaviourScript : MonoBehaviour { int count = 0; // Start is called before the first frame update void Start() { // Debug.LogError(Application.persistentDataPath); //GameObject game = null; //game.name = ""; }

// Update is called once per frame
void Update()
{
    Read();

}
public  void Read()
{
    if (count > 100) return;
    string strWriteFilePath = string.Format("{0}/Log{1}.txt", Application.persistentDataPath, count++) ;
    StreamWriter srWriteFile = new StreamWriter(strWriteFilePath);

    // srWriteFile.Close();
}

} 命令: ./TscSharp --xml /Users/XXXXXX/testPerformance/Assets/NewBehaviourScript.cs 2>result.xml 得到的结果是空的,由于家里PC今天视频线突然出问题就没测试。在公司项目代码检查时发现可以检查出来,但是不确定是不是全部检查出来了。 这个是xcode leak结果 Screen Shot 2019-04-04 at 1 26 40 AM

hanbim520 avatar Apr 03 '19 17:04 hanbim520

你好,C#的资源检查没有覆盖StreamWriter。如果有其他案例,可以继续反馈。谢谢支持

ben620 avatar Jul 01 '19 03:07 ben620