| 880 | |
| 881 | |
| 882 | void MMContext::mmcFree() |
| 883 | { |
| 884 | assert(this->mmcMMU == NULL); |
| 885 | devassert(gMMLock.lockcnt()); // Caller locked it. |
| 886 | if (mmcFuzzPort) { |
| 887 | mmcFuzzPort->close(); |
| 888 | mmcFuzzPort = NULL; |
| 889 | } |
| 890 | |
| 891 | // Cancel all the enclosed transactions and their dialogs. |
| 892 | for (unsigned i = 0; i < TE_num; i++) { |
| 893 | // When a primary transaction is deleted we may promote the secondary transaction, so delete them all: |
| 894 | for (unsigned tries = 0; tries < 3; tries++) { |
| 895 | if (mmcTE[i] != NULL) { mmcTE[i]->teCancel(); } // Removes the transaction from mmcTE via mmDisconnectTran |
| 896 | } |
| 897 | assert(mmcTE[i] == NULL); // teCancel removed it. |
| 898 | } |
| 899 | LOG(DEBUG)<<"MMContext DELETE "<<(void*)this; |
| 900 | delete this; |
| 901 | } |
| 902 | |
| 903 | // The logical channel no longer points to this Context, so release it. |
| 904 | void MMLayer::mmFreeContext(MMContext *mmc) |
no test coverage detected