SHA256
forked from ADOFAIEditorForum/ADOFAIRenderer
Fix Little Memory Leaks
This commit is contained in:
1 parent
9454226306
commit
42741c2cb2
2 files changed
+17
No files matched your search
@@ -23,6 +23,7 @@ namespace ADOFAIRenderer.Component
|
|||||||
private static GameObject? _escapeHandlerObj;
|
private static GameObject? _escapeHandlerObj;
|
||||||
private static string? _currentOutPath;
|
private static string? _currentOutPath;
|
||||||
|
|
||||||
|
private static bool _isRenderCancelled = false;
|
||||||
public static RenderSettings Configuration;
|
public static RenderSettings Configuration;
|
||||||
|
|
||||||
public struct RenderSettings
|
public struct RenderSettings
|
||||||
@@ -291,6 +292,11 @@ namespace ADOFAIRenderer.Component
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_isRenderCancelled)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (EndRequested)
|
if (EndRequested)
|
||||||
{
|
{
|
||||||
bool hasMore;
|
bool hasMore;
|
||||||
@@ -319,6 +325,8 @@ namespace ADOFAIRenderer.Component
|
|||||||
public void CancelRender()
|
public void CancelRender()
|
||||||
{
|
{
|
||||||
RenderMod.IsRendering = RenderMod.IsCapturing = false;
|
RenderMod.IsRendering = RenderMod.IsCapturing = false;
|
||||||
|
_isRenderCancelled = true;
|
||||||
|
|
||||||
StopFFmpeg(false);
|
StopFFmpeg(false);
|
||||||
EndRender();
|
EndRender();
|
||||||
}
|
}
|
||||||
@@ -354,6 +362,8 @@ namespace ADOFAIRenderer.Component
|
|||||||
ImageQueue.Clear();
|
ImageQueue.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RenderMod.FrameReader?.Dispose();
|
||||||
|
|
||||||
// 디버그 모니터 UI 정리
|
// 디버그 모니터 UI 정리
|
||||||
if (_debugMonitorObj)
|
if (_debugMonitorObj)
|
||||||
{
|
{
|
||||||
@@ -423,6 +433,7 @@ namespace ADOFAIRenderer.Component
|
|||||||
GCS.customLevelPaths = null;
|
GCS.customLevelPaths = null;
|
||||||
GCS.customLevelId = null;
|
GCS.customLevelId = null;
|
||||||
|
|
||||||
|
RenderMod.FrameReader?.Dispose();
|
||||||
ADOBase.loader.LoadSceneWithTransition(WipeDirection.StartsFromRight, "scnEditor");
|
ADOBase.loader.LoadSceneWithTransition(WipeDirection.StartsFromRight, "scnEditor");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,6 +104,12 @@ namespace ADOFAIRenderer.Util
|
|||||||
|
|
||||||
private void RecycleState(ReadbackRequestState state)
|
private void RecycleState(ReadbackRequestState state)
|
||||||
{
|
{
|
||||||
|
if (!_isInitialized)
|
||||||
|
{
|
||||||
|
state.Dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
state.Recycle();
|
state.Recycle();
|
||||||
lock (_poolLock)
|
lock (_poolLock)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user