Summary Files Commits Branches @commit @diff @stats
path: root / Pinger
diff options
context:
space:
mode:
Commitd008a57ef8f1b893e3301e2e5b08f1a1f98bc7f1 (patch)
Author
 Syndamia <kami02882@gmail.com>
2019-11-16 20:01:39 +0200
Committer
 Syndamia <kami02882@gmail.com>
2019-11-16 20:01:39 +0200
Files0f6a47caa5a9b36acce1f2d62ff1c4807695ac28 /Pinger
Shower-d008a57ef8f1b893e3301e2e5b08f1a1f98bc7f1.tar
Shower-d008a57ef8f1b893e3301e2e5b08f1a1f98bc7f1.tar.gz
Shower-d008a57ef8f1b893e3301e2e5b08f1a1f98bc7f1.zip
Parent9e0c390b0b6580cde9eae1d791f0acb63be680cc (diff)
Fixed issue of Pinger where the proces would continuous running after closing of the window
1 files changed, 4 insertions, 2 deletions
-rw-r--r--Pinger/Pinger/Form1.cs6
diff --git a/Pinger/Pinger/Form1.cs b/Pinger/Pinger/Form1.cs
index 5b4e89b..bf15a8a 100644
--- a/Pinger/Pinger/Form1.cs
+++ b/Pinger/Pinger/Form1.cs
@@ -12,11 +12,13 @@ using System.Windows.Forms;
namespace Pinger {
public partial class myNetForm : Form {
+ private Thread t;
+
public myNetForm() {
InitializeComponent();
Control.CheckForIllegalCrossThreadCalls = false;
- Thread t = new Thread(PingStatus);
+ t = new Thread(PingStatus);
t.Start();
}
@@ -24,7 +26,7 @@ namespace Pinger {
Ping p = new Ping();
PingReply pr;
- while(true) {
+ while(!this.IsDisposed) {
lblNotifyPingEvent.Visible = true;
try {
pr = p.Send(cbPingAddress.Text);