Commit c31463a
Defer closed-connection destruction via Dispatcher::deferredDelete (#212)
onConnectionEvent(RemoteClose|LocalClose) runs inside the connection's
own callback loop. Destroying the connection synchronously triggered a
use-after-free once the loop resumed. The previous workaround wrapped
the unique_ptr in a shared_ptr and posted it — now replaced with the
dispatcher's deferred-delete queue, which Connection already supports
via DeferredDeletable.
Also adds a dispatcher-thread assert at the top of onConnectionEvent so
any off-thread synthesis of connection events trips immediately instead
of silently corrupting state.1 parent e9268d7 commit c31463a
1 file changed
Lines changed: 14 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
790 | 791 | | |
791 | 792 | | |
792 | 793 | | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
793 | 799 | | |
794 | 800 | | |
795 | 801 | | |
| |||
859 | 865 | | |
860 | 866 | | |
861 | 867 | | |
862 | | - | |
863 | | - | |
864 | | - | |
| 868 | + | |
865 | 869 | | |
866 | | - | |
867 | | - | |
868 | | - | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
869 | 876 | | |
870 | | - | |
871 | | - | |
872 | | - | |
873 | | - | |
874 | | - | |
875 | | - | |
| 877 | + | |
876 | 878 | | |
877 | 879 | | |
878 | 880 | | |
| |||
0 commit comments