From 77087b08316940e6f1b0690efebbb76cf51f6bec Mon Sep 17 00:00:00 2001 From: "lixiang.cheng" Date: Thu, 11 Jun 2026 19:48:17 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix:=20rename=20typo=20fahter=20=E2=86=92?= =?UTF-8?q?=20father=20(Sample.father)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sample tree parent field was misspelled 'fahter' across the runtime profiler, the Winform client, and the InjectAPK tool. Internal field name only — no wire-protocol change. --- .../ProfilerWin/TreeView/LuaProfilerTreeView.cs | 2 +- LuaProfiler/Runtime/Core/Driver/LuaProfiler.cs | 4 ++-- LuaProfiler/Runtime/Core/NetWork/Packet/Sample.cs | 10 +++++----- .../InjectToLua/DLL/Core/Driver/LuaProfiler.cs | 8 ++++---- .../InjectToLua/DLL/Core/Driver/Sample.cs | 8 ++++---- .../LuaProfilerWinform/HookLib/Core/Common/Sample.cs | 12 ++++++------ .../LuaProfilerWinform/HookLib/Core/LuaProfiler.cs | 8 ++++---- .../Winform/NetWork/NetWorkServer.cs | 2 +- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs index 719cf31a..fc99c0e9 100644 --- a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs +++ b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs @@ -356,7 +356,7 @@ public Sample CopyToSample() for (int i = 0; i < childCount; i++) { Sample child = childs[i].CopyToSample(); - child.fahter = s; + child.father = s; } s.currentLuaMemory = 0; s.currentMonoMemory = 0; diff --git a/LuaProfiler/Runtime/Core/Driver/LuaProfiler.cs b/LuaProfiler/Runtime/Core/Driver/LuaProfiler.cs index 7a0155e3..b49b6015 100644 --- a/LuaProfiler/Runtime/Core/Driver/LuaProfiler.cs +++ b/LuaProfiler/Runtime/Core/Driver/LuaProfiler.cs @@ -220,7 +220,7 @@ public static void EndSample(IntPtr luaState) sample.costLuaGC = (int)luaGC; sample.costMonoGC = (int)monoGC; - sample.fahter = beginSampleMemoryStack.Count > 0 ? beginSampleMemoryStack.Peek() : null; + sample.father = beginSampleMemoryStack.Count > 0 ? beginSampleMemoryStack.Peek() : null; //UnityEngine.Debug.Log(sample.name); if (beginSampleMemoryStack.Count == 0) { @@ -234,7 +234,7 @@ public static void EndSample(IntPtr luaState) #endif } //释放掉被累加的Sample - if (beginSampleMemoryStack.Count != 0 && sample.fahter == null) + if (beginSampleMemoryStack.Count != 0 && sample.father == null) { sample.Restore(); } diff --git a/LuaProfiler/Runtime/Core/NetWork/Packet/Sample.cs b/LuaProfiler/Runtime/Core/NetWork/Packet/Sample.cs index e7b85463..8b76aec1 100644 --- a/LuaProfiler/Runtime/Core/NetWork/Packet/Sample.cs +++ b/LuaProfiler/Runtime/Core/NetWork/Packet/Sample.cs @@ -115,7 +115,7 @@ public string fullName while (f != null) { value = f.name + value; - f = f.fahter; + f = f.father; } _fullName = string.Intern(value); childDict[name] = _fullName; @@ -130,7 +130,7 @@ public string fullName } } - public Sample fahter + public Sample father { set { @@ -175,8 +175,8 @@ public void AddSample(Sample s) for (int i = s.childs.Count - 1; i >= 0; i--) { var item = s.childs[i]; - item.fahter = this; - if (item.fahter != s) + item.father = this; + if (item.father != s) { s.childs.RemoveAt(i); } @@ -247,7 +247,7 @@ public Sample Clone() for (int i = 0; i < childCount; i++) { Sample child = childs[i].Clone(); - child.fahter = s; + child.father = s; } s.currentLuaMemory = currentLuaMemory; diff --git a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/LuaProfiler.cs b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/LuaProfiler.cs index cfd70010..56b95d12 100644 --- a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/LuaProfiler.cs +++ b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/LuaProfiler.cs @@ -129,7 +129,7 @@ public static void PopAllSampleWhenLateUpdate(IntPtr luaState) while(beginSampleMemoryStack.Count > 0) { var item = beginSampleMemoryStack.Pop(); - if (item.fahter == null) + if (item.father == null) { if (beginSampleMemoryStack.Count > 0) { @@ -157,7 +157,7 @@ public static void PopAllSampleWhenLateUpdate(IntPtr luaState) item.currentLuaMemory = (int)LuaLib.GetLuaMemory(luaState); for (int i = 0, imax = popChilds.Count; i < imax; i++) { - popChilds[i].fahter = item; + popChilds[i].father = item; } popChilds.Clear(); NetWorkClient.SendMessage(item); @@ -213,7 +213,7 @@ public static void EndSample(IntPtr luaState) sample.Restore(); return; } - sample.fahter = beginSampleMemoryStack.Count > 0 ? beginSampleMemoryStack.Peek() : null; + sample.father = beginSampleMemoryStack.Count > 0 ? beginSampleMemoryStack.Peek() : null; //UnityEngine.Debug.Log(sample.name); if (beginSampleMemoryStack.Count == 0) { @@ -240,7 +240,7 @@ public static void EndSample(IntPtr luaState) NetWorkClient.SendMessage(sample); } //释放掉被累加的Sample - if (beginSampleMemoryStack.Count != 0 && sample.fahter == null) + if (beginSampleMemoryStack.Count != 0 && sample.father == null) { sample.Restore(); } diff --git a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/Sample.cs b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/Sample.cs index 73c9a1b8..482736d7 100644 --- a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/Sample.cs +++ b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/Sample.cs @@ -177,7 +177,7 @@ public bool CheckSampleValid() } #region property - public Sample fahter + public Sample father { set { @@ -263,8 +263,8 @@ public void AddSample(Sample s) for (int i = s.childs.Count - 1; i >= 0; i--) { var item = s.childs[i]; - item.fahter = this; - if (item.fahter != s) + item.father = this; + if (item.father != s) { s.childs.RemoveAt(i); } @@ -303,7 +303,7 @@ public Sample Clone() for (int i = 0; i < childCount; i++) { Sample child = childs[i].Clone(); - child.fahter = s; + child.father = s; } s.currentLuaMemory = currentLuaMemory; diff --git a/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/Common/Sample.cs b/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/Common/Sample.cs index 8253e3ce..34c4a68d 100644 --- a/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/Common/Sample.cs +++ b/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/Common/Sample.cs @@ -286,7 +286,7 @@ public string fullName while (f != null) { value = f.name + value; - f = f.fahter; + f = f.father; } _fullName = value; childDict[name] = string.Intern(_fullName); @@ -301,7 +301,7 @@ public string fullName } } - public Sample fahter + public Sample father { set { @@ -395,8 +395,8 @@ public void AddSample(Sample s) for (int i = s.childs.Count - 1; i >= 0; i--) { var item = s.childs[i]; - item.fahter = this; - if (item.fahter != s) + item.father = this; + if (item.father != s) { s.childs.RemoveAt(i); } @@ -418,7 +418,7 @@ public Sample Clone() for (int i = 0; i < childCount; i++) { Sample child = childs[i].Clone(); - child.fahter = s; + child.father = s; } s.currentLuaMemory = currentLuaMemory; @@ -541,7 +541,7 @@ public static Sample Deserialize(BinaryReader b) len = b.ReadInt32(); datas = b.ReadBytes(len); Sample child = Deserialize(datas); - child.fahter = s; + child.father = s; } bool hasCapture = b.ReadBoolean(); diff --git a/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/LuaProfiler.cs b/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/LuaProfiler.cs index e7f7cfac..5168a2a2 100644 --- a/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/LuaProfiler.cs +++ b/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/LuaProfiler.cs @@ -144,7 +144,7 @@ public static void PopAllSampleWhenLateUpdate(IntPtr luaState) while(beginSampleMemoryStack.Count > 0) { var item = beginSampleMemoryStack.Pop(); - if (item.fahter == null) + if (item.father == null) { if (beginSampleMemoryStack.Count > 0) { @@ -172,7 +172,7 @@ public static void PopAllSampleWhenLateUpdate(IntPtr luaState) item.currentLuaMemory = (int)LuaDLL.GetLuaMemory(luaState); for (int i = 0, imax = popChilds.Count; i < imax; i++) { - popChilds[i].fahter = item; + popChilds[i].father = item; } popChilds.Clear(); // TODO @@ -225,7 +225,7 @@ public static void EndSample(IntPtr luaState) sample.Restore(); return; } - sample.fahter = beginSampleMemoryStack.Count > 0 ? beginSampleMemoryStack.Peek() : null; + sample.father = beginSampleMemoryStack.Count > 0 ? beginSampleMemoryStack.Peek() : null; //UnityEngine.Debug.Log(sample.name); if (beginSampleMemoryStack.Count == 0) { @@ -233,7 +233,7 @@ public static void EndSample(IntPtr luaState) NetWorkClient.SendMessage(sample); } //释放掉被累加的Sample - if (beginSampleMemoryStack.Count != 0 && sample.fahter == null) + if (beginSampleMemoryStack.Count != 0 && sample.father == null) { sample.Restore(); } diff --git a/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/Winform/NetWork/NetWorkServer.cs b/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/Winform/NetWork/NetWorkServer.cs index e036591a..b9084432 100644 --- a/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/Winform/NetWork/NetWorkServer.cs +++ b/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/Winform/NetWork/NetWorkServer.cs @@ -307,7 +307,7 @@ public static Sample Deserialize(BinaryReader br) int count = br.ReadUInt16(); for (int i = 0, imax = count; i < imax; i++) { - Deserialize(br).fahter = s; + Deserialize(br).father = s; } int lua_gc = 0; From 0708a1b1ae44d8dbf1be06f178918869839f8bb5 Mon Sep 17 00:00:00 2001 From: "lixiang.cheng" Date: Thu, 11 Jun 2026 19:48:24 +0800 Subject: [PATCH 2/8] =?UTF-8?q?fix:=20rename=20typo=20OnReciveSample=20?= =?UTF-8?q?=E2=86=92=20OnReceiveSample?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Static receive-callback field on LuaRefInfo and Sample packets was misspelled 'OnReciveSample'. Internal field only. --- LuaProfiler/Runtime/Core/NetWork/Packet/LuaRefInfo.cs | 10 +++++----- LuaProfiler/Runtime/Core/NetWork/Packet/Sample.cs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/LuaProfiler/Runtime/Core/NetWork/Packet/LuaRefInfo.cs b/LuaProfiler/Runtime/Core/NetWork/Packet/LuaRefInfo.cs index 080d256f..ade55da9 100644 --- a/LuaProfiler/Runtime/Core/NetWork/Packet/LuaRefInfo.cs +++ b/LuaProfiler/Runtime/Core/NetWork/Packet/LuaRefInfo.cs @@ -62,16 +62,16 @@ public LuaRefInfo Clone() #region static - private static Action OnReciveSample; + private static Action OnReceiveSample; public static void RegAction(Action action) { - OnReciveSample = action; + OnReceiveSample = action; } public static void UnRegAction() { - OnReciveSample = null; + OnReceiveSample = null; } #endregion @@ -95,9 +95,9 @@ public override void Write(MBinaryWriter bw) public override void OnRun() { - if (OnReciveSample != null) + if (OnReceiveSample != null) { - OnReciveSample.Invoke(this); + OnReceiveSample.Invoke(this); } } diff --git a/LuaProfiler/Runtime/Core/NetWork/Packet/Sample.cs b/LuaProfiler/Runtime/Core/NetWork/Packet/Sample.cs index 8b76aec1..85ef4bde 100644 --- a/LuaProfiler/Runtime/Core/NetWork/Packet/Sample.cs +++ b/LuaProfiler/Runtime/Core/NetWork/Packet/Sample.cs @@ -260,16 +260,16 @@ public Sample Clone() #region static - private static Action OnReciveSample; + private static Action OnReceiveSample; public static void RegAction(Action action) { - OnReciveSample = action; + OnReceiveSample = action; } public static void UnRegAction() { - OnReciveSample = null; + OnReceiveSample = null; } #endregion @@ -831,9 +831,9 @@ public override void Write(MBinaryWriter bw) public override void OnRun() { - if (OnReciveSample != null) + if (OnReceiveSample != null) { - OnReciveSample.Invoke(this); + OnReceiveSample.Invoke(this); } } From f6c371ebff546d921605664fbec50829c1b2f174 Mon Sep 17 00:00:00 2001 From: "lixiang.cheng" Date: Thu, 11 Jun 2026 19:48:39 +0800 Subject: [PATCH 3/8] =?UTF-8?q?fix:=20rename=20typo=20UnRegistReceive=20?= =?UTF-8?q?=E2=86=92=20UnRegisterReceive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Method was inconsistent with siblings RegisterOnReceiveSample / RegisterOnReceiveRefInfo / RegisterOnReceiveDiffInfo in the same class. Renamed to UnRegisterReceive for symmetry. Public API name change — any external caller of LuaProfiler.UnRegistReceive() will need to update, but the only callers in this repo are the Editor window. --- .../Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs | 4 ++-- LuaProfiler/Runtime/Core/Driver/LuaProfiler.cs | 2 +- .../LuaProfilerWinform/HookLib/Core/LuaProfiler.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs index 935d174d..7073e120 100644 --- a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs +++ b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs @@ -349,7 +349,7 @@ void DoToolbar() NetWorkMgrClient.Disconnect(); currentFrameIndex = 0; m_TreeView.Clear(true); - LuaProfiler.UnRegistReceive(); + LuaProfiler.UnRegisterReceive(); Sample.UnRegAction(); LuaRefInfo.UnRegAction(); @@ -1111,7 +1111,7 @@ private void OpenLocalMode() NetWorkMgrClient.Disconnect(); currentFrameIndex = 0; m_TreeView.Clear(true); - LuaProfiler.UnRegistReceive(); + LuaProfiler.UnRegisterReceive(); Sample.UnRegAction(); LuaRefInfo.UnRegAction(); LuaProfiler.RegisterOnReceiveSample(m_TreeView.LoadRootSample); diff --git a/LuaProfiler/Runtime/Core/Driver/LuaProfiler.cs b/LuaProfiler/Runtime/Core/Driver/LuaProfiler.cs index b49b6015..9ce1f418 100644 --- a/LuaProfiler/Runtime/Core/Driver/LuaProfiler.cs +++ b/LuaProfiler/Runtime/Core/Driver/LuaProfiler.cs @@ -76,7 +76,7 @@ public static void RegisterOnReceiveDiffInfo(Action onReceive) m_onReceiveDiff = onReceive; } - public static void UnRegistReceive() + public static void UnRegisterReceive() { m_onReceiveSample = null; m_onReceiveRef = null; diff --git a/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/LuaProfiler.cs b/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/LuaProfiler.cs index 5168a2a2..c33e5ec9 100644 --- a/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/LuaProfiler.cs +++ b/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/LuaProfiler.cs @@ -64,7 +64,7 @@ public static void RegisterOnReceiveDiffInfo(Action onReceive) m_onReceiveDiff = onReceive; } - public static void UnRegistReceive() + public static void UnRegisterReceive() { m_onReceiveSample = null; m_onReceiveRef = null; From d94d430bcc6456bc9d59b226502ccb09ac338081 Mon Sep 17 00:00:00 2001 From: "lixiang.cheng" Date: Thu, 11 Jun 2026 19:48:46 +0800 Subject: [PATCH 4/8] =?UTF-8?q?fix:=20rename=20typo=20IsMonoBehavior=20?= =?UTF-8?q?=E2=86=92=20IsMonoBehaviour?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unity's class is spelled 'MonoBehaviour' (British). The local helper that checks whether a TypeDefinition derives from UnityEngine.MonoBehaviour was named with the American spelling 'IsMonoBehavior', and the literal string it compared against (UnityEngine.MonoBehaviour) used the British spelling — the two were inconsistent. Aligns with the local 'isMonoBehaviour' boolean in the same file. Private API only. --- LuaProfiler/Editor/StartUp.cs | 6 +++--- .../Tools/InjectAPKTool/InjectToLua/InjectMethods.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LuaProfiler/Editor/StartUp.cs b/LuaProfiler/Editor/StartUp.cs index 7798130b..0c8eea0c 100644 --- a/LuaProfiler/Editor/StartUp.cs +++ b/LuaProfiler/Editor/StartUp.cs @@ -111,7 +111,7 @@ public static List FindReferenceAssembly(string name) return result; } - private static bool IsMonoBehavior(TypeDefinition td) + private static bool IsMonoBehaviour(TypeDefinition td) { if (td == null) return false; @@ -127,7 +127,7 @@ private static bool IsMonoBehavior(TypeDefinition td) } else { - return IsMonoBehavior(td.BaseType.Resolve()); + return IsMonoBehaviour(td.BaseType.Resolve()); } } } @@ -192,7 +192,7 @@ private static void InjectAllMethods(string injectPath, string profilerPath) { continue; } - bool isMonoBehaviour = IsMonoBehavior(item.DeclaringType.BaseType.Resolve()); + bool isMonoBehaviour = IsMonoBehaviour(item.DeclaringType.BaseType.Resolve()); if (isMonoBehaviour) { continue; diff --git a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/InjectMethods.cs b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/InjectMethods.cs index b63039f7..0b02ed01 100644 --- a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/InjectMethods.cs +++ b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/InjectMethods.cs @@ -123,7 +123,7 @@ public static void InjectAllMethods(string injectPath, string profilerPath) { continue; } - bool isMonoBehaviour = IsMonoBehavior(item.DeclaringType.BaseType.Resolve()); + bool isMonoBehaviour = IsMonoBehaviour(item.DeclaringType.BaseType.Resolve()); if (isMonoBehaviour) { continue; @@ -240,7 +240,7 @@ public static void HookLuaFun(string luaPath, string profilerPath) } #region try finally - private static bool IsMonoBehavior(TypeDefinition td) + private static bool IsMonoBehaviour(TypeDefinition td) { if (td == null) return false; @@ -256,7 +256,7 @@ private static bool IsMonoBehavior(TypeDefinition td) } else { - return IsMonoBehavior(td.BaseType.Resolve()); + return IsMonoBehaviour(td.BaseType.Resolve()); } } } From a8528b9b3ff23f8f0f78e911766dc00f784e8795 Mon Sep 17 00:00:00 2001 From: "lixiang.cheng" Date: Thu, 11 Jun 2026 19:48:53 +0800 Subject: [PATCH 5/8] =?UTF-8?q?fix:=20rename=20typo=20Destory=20=E2=86=92?= =?UTF-8?q?=20Destroy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The local wrapper Destroy(UnityEngine.Object o) in LuaProfilerWindow was misspelled 'Destory'. Its body already calls the real Unity API Object.Destroy / Object.DestroyImmediate correctly, so this was a naming typo only. Also fixes the same typo in a UI label string on LuaDiffScrollView. --- .../ProfilerWin/TreeView/LuaDiffScrollView.cs | 2 +- .../ProfilerWin/TreeView/LuaProfilerWindow.cs | 36 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaDiffScrollView.cs b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaDiffScrollView.cs index d16e2108..378a861c 100644 --- a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaDiffScrollView.cs +++ b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaDiffScrollView.cs @@ -152,7 +152,7 @@ public void DoRefScroll() GUILayout.EndScrollView(); GUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("Destory null values count:" + drawCount, GUILayout.Width(200)); + EditorGUILayout.LabelField("Destroy null values count:" + drawCount, GUILayout.Width(200)); if (GUILayout.Button("ShowLog", GUILayout.Width(100))) { ShowLog("null", luaDiff.nullRef, luaDiff.nullDetail); diff --git a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs index 7073e120..0e6ee3c4 100644 --- a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs +++ b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs @@ -169,21 +169,21 @@ void OnEnable() } oldStartUrl = null; oldEndUrl = null; - Destory(oldStartT); - Destory(oldEndT); + Destroy(oldStartT); + Destroy(oldEndT); disableChart = null; - Destory(disableChart); + Destroy(disableChart); luaChart = null; - Destory(luaChart); + Destroy(luaChart); monoChart = null; - Destory(monoChart); + Destroy(monoChart); fpsChart = null; - Destory(fpsChart); + Destroy(fpsChart); pssChart = null; - Destory(pssChart); + Destroy(pssChart); powrChart = null; - Destory(powrChart); - Destory(boxTex); + Destroy(powrChart); + Destroy(boxTex); boxTex = null; m_gs = null; currentStyle = null; @@ -196,25 +196,25 @@ void OnEnable() private void OnDisable() { - Destory(disableChart); + Destroy(disableChart); disableChart = null; - Destory(luaChart); + Destroy(luaChart); luaChart = null; - Destory(monoChart); + Destroy(monoChart); monoChart = null; - Destory(fpsChart); + Destroy(fpsChart); fpsChart = null; - Destory(pssChart); + Destroy(pssChart); pssChart = null; - Destory(powrChart); + Destroy(powrChart); powrChart = null; - Destory(boxTex); + Destroy(boxTex); boxTex = null; LuaDeepProfilerSetting.ProfilerWinOpen = false; EditorApplication.update -= m_TreeView.DequeueSample; } - void Destory(UnityEngine.Object o) + void Destroy(UnityEngine.Object o) { if (o == null) return; if (Application.isPlaying) @@ -659,7 +659,7 @@ void DoChart() currentStyle = new GUIStyle(EditorStyles.helpBox); if (boxTex != null) { - Destory(boxTex); + Destroy(boxTex); boxTex = null; } boxTex = GenTextureColor(15, 15, boxColor); From ac9ad6386f94fbe6017171ae2e85f224e72cad64 Mon Sep 17 00:00:00 2001 From: "lixiang.cheng" Date: Thu, 11 Jun 2026 19:48:58 +0800 Subject: [PATCH 6/8] =?UTF-8?q?fix:=20rename=20typo=20powrChart=20?= =?UTF-8?q?=E2=86=92=20powerChart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Custom Texture2D field for the power-usage chart was missing the 'e' between 'pow' and 'r'. Renamed to powerChart to match its siblings luaChart, monoChart, fpsChart, pssChart and the local powerColor constant. Private field only. --- .../ProfilerWin/TreeView/LuaProfilerWindow.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs index 0e6ee3c4..e8bb5306 100644 --- a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs +++ b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs @@ -101,7 +101,7 @@ public class LuaProfilerWindow : EditorWindow private Texture2D monoChart; private Texture2D fpsChart; private Texture2D pssChart; - private Texture2D powrChart; + private Texture2D powerChart; private Texture2D boxTex; private GUIStyle currentStyle; private GUIStyle m_gs; @@ -181,8 +181,8 @@ void OnEnable() Destroy(fpsChart); pssChart = null; Destroy(pssChart); - powrChart = null; - Destroy(powrChart); + powerChart = null; + Destroy(powerChart); Destroy(boxTex); boxTex = null; m_gs = null; @@ -206,8 +206,8 @@ private void OnDisable() fpsChart = null; Destroy(pssChart); pssChart = null; - Destroy(powrChart); - powrChart = null; + Destroy(powerChart); + powerChart = null; Destroy(boxTex); boxTex = null; LuaDeepProfilerSetting.ProfilerWinOpen = false; @@ -271,9 +271,9 @@ private void LoadChartTexture() { pssChart = GenTextureColor(15, 15, pssColor); } - if (powrChart == null) + if (powerChart == null) { - powrChart = GenTextureColor(15, 15, powerColor); + powerChart = GenTextureColor(15, 15, powerColor); } } @@ -605,7 +605,7 @@ void DoChartToggle() GUILayout.Space(5); EditorGUILayout.BeginHorizontal(); - t = isShowPowerChart ? powrChart : disableChart; + t = isShowPowerChart ? powerChart : disableChart; isShowPowerChart = GUILayout.Toggle(isShowPowerChart, t, EditorStyles.label, GUILayout.Width(15), GUILayout.Height(15)); GUILayout.Label("Power", GUILayout.Width(40)); GUILayout.Label(m_TreeView.GetPower()); From ee670ae2340ac1db326426f52f9a46cb3871af60 Mon Sep 17 00:00:00 2001 From: "lixiang.cheng" Date: Thu, 11 Jun 2026 19:49:04 +0800 Subject: [PATCH 7/8] =?UTF-8?q?fix:=20rename=20typo=20WaitDestory=20?= =?UTF-8?q?=E2=86=92=20WaitDestroy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Private method subscribed to EditorApplication.update as a deferred destroy hook (count ticks, then call Object.Destroy). The same method is duplicated in the InjectAPK tool's LuaHookSetup — both fixed in one commit to keep them in sync. --- LuaProfiler/Runtime/Core/LuaHookSetup.cs | 6 +++--- .../InjectAPKTool/InjectToLua/DLL/Core/LuaHookSetup.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LuaProfiler/Runtime/Core/LuaHookSetup.cs b/LuaProfiler/Runtime/Core/LuaHookSetup.cs index 9a3dcbb0..1f115119 100644 --- a/LuaProfiler/Runtime/Core/LuaHookSetup.cs +++ b/LuaProfiler/Runtime/Core/LuaHookSetup.cs @@ -173,19 +173,19 @@ private void OnApplicationQuit() #if UNITY_EDITOR desotryCount = 0; Destroy(gameObject); - UnityEditor.EditorApplication.update += WaitDestory; + UnityEditor.EditorApplication.update += WaitDestroy; #endif NetWorkMgr.Close(); } #if UNITY_EDITOR int desotryCount = 0; - private void WaitDestory() + private void WaitDestroy() { desotryCount++; if (desotryCount > 10) { - UnityEditor.EditorApplication.update -= WaitDestory; + UnityEditor.EditorApplication.update -= WaitDestroy; if (LuaProfiler.mainL != IntPtr.Zero) { LuaDLL.lua_close(LuaProfiler.mainL); diff --git a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/LuaHookSetup.cs b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/LuaHookSetup.cs index 365dfe6b..693d32f5 100644 --- a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/LuaHookSetup.cs +++ b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/LuaHookSetup.cs @@ -144,7 +144,7 @@ private void OnApplicationQuit() #if UNITY_EDITOR desotryCount = 0; Destroy(gameObject); - UnityEditor.EditorApplication.update += WaitDestory; + UnityEditor.EditorApplication.update += WaitDestroy; #else NetWorkClient.Close(); #endif @@ -152,12 +152,12 @@ private void OnApplicationQuit() #if UNITY_EDITOR int desotryCount = 0; - private void WaitDestory() + private void WaitDestroy() { desotryCount++; if (desotryCount > 10) { - UnityEditor.EditorApplication.update -= WaitDestory; + UnityEditor.EditorApplication.update -= WaitDestroy; if (LuaProfiler.mainL != IntPtr.Zero) { LuaDLL.lua_close(LuaProfiler.mainL); From 57af1505c96a7e89a3ce73911b05d236fcf26f1e Mon Sep 17 00:00:00 2001 From: "lixiang.cheng" Date: Thu, 11 Jun 2026 19:49:11 +0800 Subject: [PATCH 8/8] =?UTF-8?q?fix:=20rename=20typo=20desotryCount=20?= =?UTF-8?q?=E2=86=92=20destroyCount?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tick counter used by WaitDestroy to wait a few EditorApplication.update frames before actually destroying the GameObject. Private field only. --- LuaProfiler/Runtime/Core/LuaHookSetup.cs | 10 +++++----- .../InjectAPKTool/InjectToLua/DLL/Core/LuaHookSetup.cs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/LuaProfiler/Runtime/Core/LuaHookSetup.cs b/LuaProfiler/Runtime/Core/LuaHookSetup.cs index 1f115119..748dcc58 100644 --- a/LuaProfiler/Runtime/Core/LuaHookSetup.cs +++ b/LuaProfiler/Runtime/Core/LuaHookSetup.cs @@ -171,7 +171,7 @@ private void LateUpdate() private void OnApplicationQuit() { #if UNITY_EDITOR - desotryCount = 0; + destroyCount = 0; Destroy(gameObject); UnityEditor.EditorApplication.update += WaitDestroy; #endif @@ -179,11 +179,11 @@ private void OnApplicationQuit() } #if UNITY_EDITOR - int desotryCount = 0; + int destroyCount = 0; private void WaitDestroy() { - desotryCount++; - if (desotryCount > 10) + destroyCount++; + if (destroyCount > 10) { UnityEditor.EditorApplication.update -= WaitDestroy; if (LuaProfiler.mainL != IntPtr.Zero) @@ -193,7 +193,7 @@ private void WaitDestroy() LuaDLL.Uninstall(); LuaProfiler.mainL = IntPtr.Zero; NetWorkMgr.Close(); - desotryCount = 0; + destroyCount = 0; } } #endif diff --git a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/LuaHookSetup.cs b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/LuaHookSetup.cs index 693d32f5..7ccaffa8 100644 --- a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/LuaHookSetup.cs +++ b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/LuaHookSetup.cs @@ -142,7 +142,7 @@ private void LateUpdate() private void OnApplicationQuit() { #if UNITY_EDITOR - desotryCount = 0; + destroyCount = 0; Destroy(gameObject); UnityEditor.EditorApplication.update += WaitDestroy; #else @@ -151,11 +151,11 @@ private void OnApplicationQuit() } #if UNITY_EDITOR - int desotryCount = 0; + int destroyCount = 0; private void WaitDestroy() { - desotryCount++; - if (desotryCount > 10) + destroyCount++; + if (destroyCount > 10) { UnityEditor.EditorApplication.update -= WaitDestroy; if (LuaProfiler.mainL != IntPtr.Zero) @@ -164,7 +164,7 @@ private void WaitDestroy() } LuaProfiler.mainL = IntPtr.Zero; NetWorkClient.Close(); - desotryCount = 0; + destroyCount = 0; } } #endif