Threads werden nicht mehr im Konstruktor gestartet, um race conditions zu
vermeiden
This commit is contained in:
@@ -17,7 +17,6 @@ namespace WorldOfPeacecraft
|
||||
public Gui ()
|
||||
{
|
||||
AllocConsole();
|
||||
InitializeComponents();
|
||||
}
|
||||
|
||||
public void SetBackend (IBackend backend)
|
||||
@@ -25,6 +24,13 @@ namespace WorldOfPeacecraft
|
||||
Backend = backend;
|
||||
}
|
||||
|
||||
protected override void OnLoad (EventArgs e)
|
||||
{
|
||||
base.OnLoad (e);
|
||||
InitializeComponents ();
|
||||
Backend.StartThreads ();
|
||||
}
|
||||
|
||||
public void InitializeComponents ()
|
||||
{
|
||||
this.SuspendLayout();
|
||||
@@ -40,7 +46,6 @@ namespace WorldOfPeacecraft
|
||||
|
||||
this.Controls.Add(Board);
|
||||
this.ResumeLayout();
|
||||
this.PerformLayout();
|
||||
}
|
||||
|
||||
protected override void OnClosing (System.ComponentModel.CancelEventArgs e)
|
||||
|
||||
@@ -10,6 +10,8 @@ namespace WorldOfPeacecraft
|
||||
|
||||
IEnumerable<IPositionable> GetDragons();
|
||||
|
||||
void StartThreads();
|
||||
|
||||
void Stop();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user