Skip to content

Fixed memory leak when using EditorCoroutine.cs#252

Open
GammaFoxTBG wants to merge 1 commit intoPlayFab:masterfrom
GammaFoxTBG:editorcoroutine-memory-leak-fix
Open

Fixed memory leak when using EditorCoroutine.cs#252
GammaFoxTBG wants to merge 1 commit intoPlayFab:masterfrom
GammaFoxTBG:editorcoroutine-memory-leak-fix

Conversation

@GammaFoxTBG
Copy link

Fixed memory leak issue, caused by the EditorCoroutine class not disposing the web request after.

A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
Unity.Collections.NativeArray`1:.ctor(Byte[], Allocator)
UnityEngine.Networking.UploadHandlerRaw:.ctor(Byte[])
PlayFab.PfEditor.PlayFabEditorHttp:MakeApiCall(String, String, GetTitleDataRequest, Action`1, Action`1) (at Assets\PlayFabEditorExtensions\Editor\Scripts\PlayFabEditorSDK\PlayFabEditorHttp.cs:85)
PlayFab.PfEditor.PlayFabEditorApi:GetTitleInternalData(Action`1, Action`1) (at Assets\PlayFabEditorExtensions\Editor\Scripts\PlayFabEditorSDK\PlayFabEditorApi.cs:69)
PlayFab.PfEditor.TitleInternalDataViewer:RefreshInternalTitleData() (at Assets\PlayFabEditorExtensions\Editor\Scripts\Components\TitleInternalDataViewer.cs:123)
PlayFab.PfEditor.TitleInternalDataViewer:Draw() (at Assets\PlayFabEditorExtensions\Editor\Scripts\Components\TitleInternalDataViewer.cs:28)
PlayFab.PfEditor.PlayFabEditorDataMenu:DrawDataPanel() (at Assets\PlayFabEditorExtensions\Editor\Scripts\Panels\PlayFabEditorDataMenu.cs:52)
PlayFab.PfEditor.PlayFabEditor:OnGuiInternal() (at Assets\PlayFabEditorExtensions\Editor\PlayFabEditor.cs:146)
PlayFab.PfEditor.PlayFabEditor:HideRepaintErrors(Action) (at Assets\PlayFabEditorExtensions\Editor\PlayFabEditor.cs:184)
PlayFab.PfEditor.PlayFabEditor:OnGUI() (at Assets\PlayFabEditorExtensions\Editor\PlayFabEditor.cs:116)
UnityEditor.HostView:InvokeOnGUI(Rect)
UnityEditor.DockArea:DrawView(Rect)
UnityEditor.DockArea:OldOnGUI()
UnityEngine.UIElements.IMGUIContainer:DoOnGUI(Event, Matrix4x4, Rect, Boolean, Rect, Action, Boolean)
UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent(Event, Matrix4x4, Rect, Action, Boolean)
UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent(Event, Action, Boolean)
UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent(Event, Boolean)
UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUIRaw(EventBase, Boolean, Boolean)
UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUI(EventBase, Boolean, Boolean)
UnityEngine.UIElements.IMGUIContainer:HandleEvent(EventBase)
UnityEngine.UIElements.CallbackEventHandler:HandleEventAtTargetPhase(EventBase)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy:DispatchEvent(EventBase, IPanel)
UnityEngine.UIElements.EventDispatcher:ApplyDispatchingStrategies(EventBase, IPanel, Boolean)
UnityEngine.UIElements.EventDispatcher:ProcessEvent(EventBase, IPanel)
UnityEngine.UIElements.EventDispatcher:ProcessEventQueue()
UnityEngine.UIElements.EventDispatcher:OpenGate()
UnityEngine.UIElements.EventDispatcherGate:Dispose()
UnityEngine.UIElements.EventDispatcher:ProcessEvent(EventBase, IPanel)
UnityEngine.UIElements.EventDispatcher:Dispatch(EventBase, IPanel, DispatchMode)
UnityEngine.UIElements.BaseVisualElementPanel:SendEvent(EventBase, DispatchMode)
UnityEngine.UIElements.UIElementsUtility:DoDispatch(BaseVisualElementPanel)
UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent(Int32, IntPtr, Boolean&)
UnityEngine.UIElements.UIEventRegistration:ProcessEvent(Int32, IntPtr)
UnityEngine.UIElements.<>c:<.cctor>b__1_2(Int32, IntPtr)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Fixed memory leak issue, caused by the EditorCoroutine class not disposing the web request after.

```
A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
Unity.Collections.NativeArray`1:.ctor(Byte[], Allocator)
UnityEngine.Networking.UploadHandlerRaw:.ctor(Byte[])
PlayFab.PfEditor.PlayFabEditorHttp:MakeApiCall(String, String, GetTitleDataRequest, Action`1, Action`1) (at Assets\PlayFabEditorExtensions\Editor\Scripts\PlayFabEditorSDK\PlayFabEditorHttp.cs:85)
PlayFab.PfEditor.PlayFabEditorApi:GetTitleInternalData(Action`1, Action`1) (at Assets\PlayFabEditorExtensions\Editor\Scripts\PlayFabEditorSDK\PlayFabEditorApi.cs:69)
PlayFab.PfEditor.TitleInternalDataViewer:RefreshInternalTitleData() (at Assets\PlayFabEditorExtensions\Editor\Scripts\Components\TitleInternalDataViewer.cs:123)
PlayFab.PfEditor.TitleInternalDataViewer:Draw() (at Assets\PlayFabEditorExtensions\Editor\Scripts\Components\TitleInternalDataViewer.cs:28)
PlayFab.PfEditor.PlayFabEditorDataMenu:DrawDataPanel() (at Assets\PlayFabEditorExtensions\Editor\Scripts\Panels\PlayFabEditorDataMenu.cs:52)
PlayFab.PfEditor.PlayFabEditor:OnGuiInternal() (at Assets\PlayFabEditorExtensions\Editor\PlayFabEditor.cs:146)
PlayFab.PfEditor.PlayFabEditor:HideRepaintErrors(Action) (at Assets\PlayFabEditorExtensions\Editor\PlayFabEditor.cs:184)
PlayFab.PfEditor.PlayFabEditor:OnGUI() (at Assets\PlayFabEditorExtensions\Editor\PlayFabEditor.cs:116)
UnityEditor.HostView:InvokeOnGUI(Rect)
UnityEditor.DockArea:DrawView(Rect)
UnityEditor.DockArea:OldOnGUI()
UnityEngine.UIElements.IMGUIContainer:DoOnGUI(Event, Matrix4x4, Rect, Boolean, Rect, Action, Boolean)
UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent(Event, Matrix4x4, Rect, Action, Boolean)
UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent(Event, Action, Boolean)
UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent(Event, Boolean)
UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUIRaw(EventBase, Boolean, Boolean)
UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUI(EventBase, Boolean, Boolean)
UnityEngine.UIElements.IMGUIContainer:HandleEvent(EventBase)
UnityEngine.UIElements.CallbackEventHandler:HandleEventAtTargetPhase(EventBase)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy:DispatchEvent(EventBase, IPanel)
UnityEngine.UIElements.EventDispatcher:ApplyDispatchingStrategies(EventBase, IPanel, Boolean)
UnityEngine.UIElements.EventDispatcher:ProcessEvent(EventBase, IPanel)
UnityEngine.UIElements.EventDispatcher:ProcessEventQueue()
UnityEngine.UIElements.EventDispatcher:OpenGate()
UnityEngine.UIElements.EventDispatcherGate:Dispose()
UnityEngine.UIElements.EventDispatcher:ProcessEvent(EventBase, IPanel)
UnityEngine.UIElements.EventDispatcher:Dispatch(EventBase, IPanel, DispatchMode)
UnityEngine.UIElements.BaseVisualElementPanel:SendEvent(EventBase, DispatchMode)
UnityEngine.UIElements.UIElementsUtility:DoDispatch(BaseVisualElementPanel)
UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent(Int32, IntPtr, Boolean&)
UnityEngine.UIElements.UIEventRegistration:ProcessEvent(Int32, IntPtr)
UnityEngine.UIElements.<>c:<.cctor>b__1_2(Int32, IntPtr)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant