| 179 | } |
| 180 | |
| 181 | void KProcess::cleanupProcess() { |
| 182 | BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(fdsMutex); |
| 183 | removeTimer(&this->timer); |
| 184 | |
| 185 | BHashTable<U32, KFileDescriptorPtr> fdsToClose = this->fds; // make a copy since we can't remove from it while iterating |
| 186 | for( const auto& n : fdsToClose ) { |
| 187 | clearFdHandle(n.value->handle); |
| 188 | } |
| 189 | this->attachedShm.clear(); |
| 190 | this->privateShm.clear(); |
| 191 | this->mappedFiles.clear(); |
| 192 | // will be handled when thread exits, we don't want to delete current memory associated with execution |
| 193 | if (memory) { |
| 194 | memory->cleanup(); |
| 195 | } |
| 196 | XServer* server = XServer::getServer(true); |
| 197 | if (server) { |
| 198 | server->processExit(id); |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | KThread* KProcess::createThread() { |
| 203 | KThread* thread = new KThread(KSystem::getNextThreadId(), shared_from_this()); |
no test coverage detected