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

Method release

src/jrd/Routine.cpp:259–295  ·  view source on GitHub ↗

Decrement the routine's use count.

Source from the content-addressed store, hash-verified

257
258// Decrement the routine's use count.
259void Routine::release(thread_db* tdbb)
260{
261 // Actually, it's possible for routines to have intermixed dependencies, so
262 // this routine can be called for the routine which is being freed itself.
263 // Hence we should just silently ignore such a situation.
264
265 if (!useCount)
266 return;
267
268 if (intUseCount > 0)
269 intUseCount--;
270
271 --useCount;
272
273#ifdef DEBUG_PROCS
274 {
275 string buffer;
276 buffer.printf(
277 "Called from CMP_decrement():\n\t Decrementing use count of %s\n",
278 getName().toString().c_str());
279 JRD_print_procedure_info(tdbb, buffer.c_str());
280 }
281#endif
282
283 // Call recursively if and only if the use count is zero AND the routine
284 // in the cache is different than this routine.
285 // The routine will be different than in the cache only if it is a
286 // floating copy, i.e. an old copy or a deleted routine.
287 if (useCount == 0 && !checkCache(tdbb))
288 {
289 if (getStatement())
290 releaseStatement(tdbb);
291
292 flags &= ~Routine::FLAG_BEING_ALTERED;
293 remove(tdbb);
294 }
295}
296
297void Routine::releaseStatement(thread_db* tdbb)
298{

Callers 1

releaseStatementMethod · 0.45

Calls 7

getNameFunction · 0.85
JRD_print_procedure_infoFunction · 0.85
getStatementFunction · 0.85
removeFunction · 0.85
printfMethod · 0.45
c_strMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected