| 701 | } |
| 702 | |
| 703 | static void PythonSessionCtx_Unlink(PythonSessionCtx* session){ |
| 704 | /* Unlink requirements if we are the only owner */ |
| 705 | for(size_t i = 0 ; i < array_len(session->requirements) ; ++i){ |
| 706 | PythonRequirementCtx* req = session->requirements[i]; |
| 707 | if (req->refCount == 2) { |
| 708 | /* We are the only owner together with the requiremnets dictionary */ |
| 709 | Gears_dictDelete(RequirementsDict, req->installName); |
| 710 | req->isInRequirementsDict = false; |
| 711 | PythonRequirementCtx_Free(req); |
| 712 | } |
| 713 | } |
| 714 | pthread_mutex_lock(&PySessionsLock); |
| 715 | PythonSessionCtx_Del(session); |
| 716 | Gears_listAddNodeTail(DeadSessionsList, session); |
| 717 | session->deadNode = Gears_listLast(DeadSessionsList); |
| 718 | pthread_mutex_unlock(&PySessionsLock); |
| 719 | } |
| 720 | |
| 721 | static void PythonSessionCtx_Free(PythonSessionCtx* session){ |
| 722 | pthread_mutex_lock(&PySessionsLock); |
no test coverage detected