vibe-core/tests/vibe.core.net.1452/source/app.d
Sönke Ludwig 179d93f09d Add test for issue #1452.
TCP connection should not crash the program if they are closed from within a finalizer. Instead, give a warning if such a class has leaked.

(cherry picked from commit 2c0adbc56170571991781cebf1e3aac1549828ad)
2016-04-10 14:40:39 +02:00

24 lines
275 B
D

import vibe.core.core;
import vibe.core.net;
import core.time : msecs;
class C {
TCPConnection m_conn;
this()
{
m_conn = connectTCP("google.com", 443);
}
~this()
{
m_conn.close();
}
}
void main()
{
auto c = new C;
// let druntime collect c during shutdown
}