MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / destroy

Method destroy

src/jrd/Attachment.cpp:109–145  ·  view source on GitHub ↗

static method

Source from the content-addressed store, hash-verified

107
108// static method
109void 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
148MemoryPool* Jrd::Attachment::createPool()

Callers

nothing calls this directly

Calls 10

JRD_get_thread_dataFunction · 0.85
EXE_unwindFunction · 0.85
setStableMethod · 0.80
manualUnlockMethod · 0.80
getSysTransactionMethod · 0.80
setStatsGroupMethod · 0.80
destroyFunction · 0.50
getStableMethod · 0.45
cancelMethod · 0.45
deletePoolMethod · 0.45

Tested by

no test coverage detected