Jelajahi Sumber

Fix: cnx.close() if connection failed

Pascal Peridont 18 tahun lalu
induk
melakukan
02d39e2c34
2 mengubah file dengan 2 tambahan dan 0 penghapusan
  1. 1 0
      std/mtwin/mail/Smtp.hx
  2. 1 0
      std/mtwin/mail/imap/Connection.hx

+ 1 - 0
std/mtwin/mail/Smtp.hx

@@ -38,6 +38,7 @@ class Smtp {
 		try {
 			cnx.connect(new Host(host),port);
 		}catch( e : Dynamic ){
+			cnx.close();
 			throw ConnectionError(host,port);
 		}
 		

+ 1 - 0
std/mtwin/mail/imap/Connection.hx

@@ -97,6 +97,7 @@ class Connection {
 		try{
 			cnx.connect( new neko.net.Host(host), port );
 		}catch( e : Dynamic ){
+			cnx.close();
 			throw ConnectionError(host,port);
 		}
 		debug("socket connected");