| 173 | } |
| 174 | |
| 175 | void MainWindow::stop() |
| 176 | { |
| 177 | if (d->flameGraphGenTask) { |
| 178 | d->flameGraphGenTask->stop(); |
| 179 | } |
| 180 | |
| 181 | if (d->timer) { |
| 182 | d->timer->stop(); |
| 183 | delete d->timer; |
| 184 | d->timer = nullptr; |
| 185 | } |
| 186 | |
| 187 | if (d->cliThread) { |
| 188 | d->cliThread->exit(0); |
| 189 | delete d->cliThread; |
| 190 | d->cliThread = nullptr; |
| 191 | } |
| 192 | |
| 193 | if (d->client) { |
| 194 | d->client->shutdown(); |
| 195 | d->client->exit(); |
| 196 | delete d->client; |
| 197 | d->client = nullptr; |
| 198 | } |
| 199 | |
| 200 | if (d->server) { |
| 201 | d->server->kill(); |
| 202 | delete d->server; |
| 203 | d->server = nullptr; |
| 204 | } |
| 205 | } |