mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-09-23 18:17:02 +00:00
Fixed file not found error
The debug.log would be deleted after launching an example, causing the example browser to complain that the file cannot be found. In reality, it should be deleted before launching an example - fixed.
This commit is contained in:
parent
d81bedf5f8
commit
342af2f927
|
@ -40,12 +40,6 @@ namespace Examples
|
||||||
{
|
{
|
||||||
static void LaunchExample(string type)
|
static void LaunchExample(string type)
|
||||||
{
|
{
|
||||||
using (TextWriterTraceListener dbg = new TextWriterTraceListener("debug.log"))
|
|
||||||
using (OpenTK.Toolkit.Init())
|
|
||||||
{
|
|
||||||
Trace.Listeners.Add(dbg);
|
|
||||||
Trace.Listeners.Add(new ConsoleTraceListener());
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (File.Exists("debug.log"))
|
if (File.Exists("debug.log"))
|
||||||
|
@ -58,6 +52,11 @@ namespace Examples
|
||||||
Trace.WriteLine(String.Format("Could not access debug.log", e.ToString()));
|
Trace.WriteLine(String.Format("Could not access debug.log", e.ToString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using (TextWriterTraceListener dbg = new TextWriterTraceListener("debug.log"))
|
||||||
|
using (OpenTK.Toolkit.Init())
|
||||||
|
{
|
||||||
|
Trace.Listeners.Add(dbg);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var example = Type.GetType(type);
|
var example = Type.GetType(type);
|
||||||
|
@ -75,6 +74,8 @@ namespace Examples
|
||||||
type, e.ToString()));
|
type, e.ToString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Trace.Listeners.Remove(dbg);
|
||||||
|
|
||||||
dbg.Flush();
|
dbg.Flush();
|
||||||
dbg.Close();
|
dbg.Close();
|
||||||
}
|
}
|
||||||
|
@ -83,6 +84,8 @@ namespace Examples
|
||||||
[STAThread]
|
[STAThread]
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
Trace.Listeners.Add(new ConsoleTraceListener());
|
||||||
|
|
||||||
if (args.Length > 0)
|
if (args.Length > 0)
|
||||||
{
|
{
|
||||||
LaunchExample(args[0]);
|
LaunchExample(args[0]);
|
||||||
|
|
Loading…
Reference in a new issue