On Sunday, 19 September 2021 at 16:27:55 UTC, jfondren wrote:

This is a sufficient patch to prevent the segfault:

```
diff --git a/echo_client.d b/echo_client.d
index 1f8270e..5ec41df 100644
--- a/echo_client.d
+++ b/echo_client.d
@@ -32,7 +32,7 @@ void main(string[] args) {
         sm.run();
     }

-    auto stopper = new Stopper();
+    scope stopper = new Stopper();
     stopper.run();

I tried stack allocated stopper in my second 'simple example' and...
No segfault, but:
http://zed.karelia.ru/0/e/oops.png
As can be seen from the screenshot, destructors of sg0 and sg1 were not called,
but at the very end something went completely wrong.

Reply via email to