发现了位于Native堆上严重的内存泄露

This commit is contained in:
2025-10-10 01:01:36 +08:00
parent 560b8f825c
commit 5539431a5b
6 changed files with 98 additions and 16 deletions

View File

@@ -647,8 +647,8 @@ namespace Demo
public void EnableScript(string sourcePath, string scriptPath, string scriptType, ScriptableObject parent)
{
#if UNITY_EDITOR
s_PreparePerfMarker = new(scriptPath);
#if UNITY_EDITOR||true
s_PreparePerfMarker = new(ScriptName);
#endif
if (isEnableScript)
{
@@ -705,7 +705,7 @@ namespace Demo
public string ScriptPath;
public string ScriptTypename;
#if UNITY_EDITOR
#if UNITY_EDITOR||true
public ProfilerMarker s_PreparePerfMarker;
#endif
public ScriptableObject Parent;
@@ -1129,7 +1129,7 @@ namespace Demo
return;
if (gameObject.activeInHierarchy == false)
return;
#if UNITY_EDITOR
#if UNITY_EDITOR||true
s_PreparePerfMarker.Begin(this);
#endif
if (tickType == TickType.Reset)
@@ -1148,7 +1148,7 @@ namespace Demo
{
child.ScriptUpdate(currentTime, deltaTime, tickType);
}
#if UNITY_EDITOR
#if UNITY_EDITOR||true
s_PreparePerfMarker.End();
#endif
}