mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Handle non-local logs, make sure they are properly owned and deleted
This commit is contained in:
@@ -57,6 +57,7 @@ namespace renderdocui.Code
|
||||
|
||||
private PersistantConfig m_Config = null;
|
||||
|
||||
private bool m_LogLocal = false;
|
||||
private bool m_LogLoaded = false;
|
||||
|
||||
private FileSystemWatcher m_LogWatcher = null;
|
||||
@@ -116,6 +117,7 @@ namespace renderdocui.Code
|
||||
public bool LogLoaded { get { return m_LogLoaded; } }
|
||||
public bool LogLoading { get { return m_LogLoadingInProgress; } }
|
||||
public string LogFileName { get { return m_LogFile; } set { if (LogLoaded) m_LogFile = value; } }
|
||||
public bool IsLogLocal { get { return m_LogLocal; } set { m_LogLocal = value; } }
|
||||
|
||||
public FetchFrameInfo FrameInfo { get { return m_FrameInfo; } }
|
||||
|
||||
@@ -455,6 +457,8 @@ namespace renderdocui.Code
|
||||
{
|
||||
m_LogFile = logFile;
|
||||
|
||||
m_LogLocal = local;
|
||||
|
||||
m_LogLoadingInProgress = true;
|
||||
|
||||
if (File.Exists(Core.ConfigFilename))
|
||||
|
||||
@@ -919,6 +919,19 @@ namespace renderdocui.Windows
|
||||
|
||||
private void switchContext(object sender, EventArgs e)
|
||||
{
|
||||
foreach (var live in m_LiveCaptures)
|
||||
if (live.CheckAllowClose() == false)
|
||||
return;
|
||||
|
||||
if (!PromptCloseLog())
|
||||
return;
|
||||
|
||||
foreach (var live in m_LiveCaptures.ToArray())
|
||||
{
|
||||
live.CleanItems();
|
||||
live.Close();
|
||||
}
|
||||
|
||||
m_Core.Renderer.DisconnectFromRemoteServer();
|
||||
|
||||
if(sender == localContext)
|
||||
@@ -1249,10 +1262,12 @@ namespace renderdocui.Windows
|
||||
return true;
|
||||
|
||||
string deletepath = "";
|
||||
bool loglocal = false;
|
||||
|
||||
if (OwnTemporaryLog)
|
||||
{
|
||||
string temppath = m_Core.LogFileName;
|
||||
loglocal = m_Core.IsLogLocal;
|
||||
|
||||
DialogResult res = DialogResult.No;
|
||||
|
||||
@@ -1286,7 +1301,7 @@ namespace renderdocui.Windows
|
||||
try
|
||||
{
|
||||
if (deletepath.Length > 0)
|
||||
File.Delete(deletepath);
|
||||
m_Core.Renderer.DeleteCapture(deletepath, loglocal);
|
||||
}
|
||||
catch (System.Exception)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user