Commit 39e705f
committed
Fix shared_ptr cycle leak in websocket_connection
Add RAII guard in start_read_loop() that clears the on_message callback
when the coroutine frame is destroyed. This breaks the reference cycle
created when users capture shared_ptr<websocket_connection> in the
callback (the standard and expected usage pattern).1 parent 57b0db3 commit 39e705f
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
36 | 45 | | |
37 | 46 | | |
38 | 47 | | |
| |||
0 commit comments