UI: Fixed crash in recent games initialization code (caused by previous commit)
This commit is contained in:
parent
63b23a7b22
commit
7afc52dc4b
2 changed files with 10 additions and 7 deletions
|
@ -44,6 +44,10 @@ namespace Mesen.GUI.Controls
|
|||
lblGameName.Text = Path.GetFileNameWithoutExtension(_recentGame.RomName);
|
||||
lblSaveDate.Text = _recentGame.Timestamp.ToString();
|
||||
|
||||
lblGameName.Visible = true;
|
||||
lblSaveDate.Visible = true;
|
||||
picPreviousState.Visible = true;
|
||||
|
||||
Task.Run(() => {
|
||||
Image img = null;
|
||||
try {
|
||||
|
@ -55,12 +59,11 @@ namespace Mesen.GUI.Controls
|
|||
}
|
||||
}
|
||||
} catch { }
|
||||
picPreviousState.Image = img;
|
||||
});
|
||||
|
||||
lblGameName.Visible = true;
|
||||
lblSaveDate.Visible = true;
|
||||
picPreviousState.Visible = true;
|
||||
this.BeginInvoke((Action)(() => {
|
||||
picPreviousState.Image = img;
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -126,8 +126,6 @@ namespace Mesen.GUI.Controls
|
|||
|
||||
public void Initialize()
|
||||
{
|
||||
InitGrid();
|
||||
|
||||
_initialized = true;
|
||||
_recentGames = new List<RecentGameInfo>();
|
||||
_currentIndex = 0;
|
||||
|
@ -157,6 +155,8 @@ namespace Mesen.GUI.Controls
|
|||
_recentGames.RemoveRange(36, _recentGames.Count - 36);
|
||||
}
|
||||
|
||||
InitGrid();
|
||||
|
||||
if(_recentGames.Count == 0) {
|
||||
this.Visible = false;
|
||||
tmrInput.Enabled = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue