Unlink from the request owner and cancel it. Fire-and-forget: the owner will self-destroy when wxWebRequest reports State_Cancelled on the main loop. We must NOT delete the owner here — doing so while a request is in flight leaves the wxWebRequest backend calling into a dead sink.
| 111 | // while a request is in flight leaves the wxWebRequest backend |
| 112 | // calling into a dead sink. |
| 113 | void StopDownload() { |
| 114 | if (m_owner) { |
| 115 | m_owner->DetachCompanion(); |
| 116 | m_owner->Stop(); |
| 117 | m_owner = NULL; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | void OnBtnCancel(wxCommandEvent& WXUNUSED(evt)) { |
| 122 | AddLogLineN(_("HTTP download cancelled")); |
nothing calls this directly
no test coverage detected