message: Implement regression test for
diff: #include "core-test.hpp"
  using namespace caf;
  +using namespace std::literals;
  namespace {
  @@ -170,3 +171,25 @@ SCENARIO("response promises allow delegation") {
  }
  END_FIXTURE_SCOPE()
  +
  +CAF_TEST("GH-1306 regression") {
  + actor_system_config cfg;
  + cfg.set("caf.scheduler.max-threads", 1u);
  + actor_system sys{cfg};
  + auto aut = sys.spawn([](caf::event_based_actor* self) -> behavior {
  + return {
  + [self](int32_t x) {
  + auto rp = self->make_response_promise();
  + self->run_delayed(1h, [rp, x]() mutable { rp.deliver(x + x); });
  + return rp;
  + },
  + };
  + });
  + scoped_actor self{sys};
  + self->send(aut, 21);
  + self->send_exit(aut, exit_reason::kill);
  + aut = nullptr;
  + // Destroying the now obsolete action now destroys the promise. If the promise
  + // access the self pointer this triggers a heap-use-after-free since the AUT
  + // has been destroyed at this point.
  +}
  