static method
| 107 | |
| 108 | // static method |
| 109 | void Jrd::Attachment::destroy(Attachment* const attachment) |
| 110 | { |
| 111 | if (!attachment) |
| 112 | return; |
| 113 | |
| 114 | StableAttachmentPart* sAtt = attachment->getStable(); |
| 115 | fb_assert(sAtt); |
| 116 | if (sAtt) |
| 117 | { |
| 118 | // break link between attachment and its stable part |
| 119 | sAtt->cancel(); |
| 120 | attachment->setStable(NULL); |
| 121 | |
| 122 | sAtt->manualUnlock(attachment->att_flags); |
| 123 | } |
| 124 | |
| 125 | thread_db* tdbb = JRD_get_thread_data(); |
| 126 | |
| 127 | jrd_tra* sysTransaction = attachment->getSysTransaction(); |
| 128 | if (sysTransaction) |
| 129 | { |
| 130 | // unwind any active system requests |
| 131 | while (sysTransaction->tra_requests) |
| 132 | EXE_unwind(tdbb, sysTransaction->tra_requests); |
| 133 | |
| 134 | jrd_tra::destroy(NULL, sysTransaction); |
| 135 | } |
| 136 | |
| 137 | Database* const dbb = attachment->att_database; |
| 138 | MemoryPool* const pool = attachment->att_pool; |
| 139 | Firebird::MemoryStats temp_stats; |
| 140 | pool->setStatsGroup(temp_stats); |
| 141 | |
| 142 | delete attachment; |
| 143 | |
| 144 | dbb->deletePool(pool); |
| 145 | } |
| 146 | |
| 147 | |
| 148 | MemoryPool* Jrd::Attachment::createPool() |
nothing calls this directly
no test coverage detected