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

Method release

src/yvalve/PluginManager.cpp:704–738  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

702 static GlobalPtr<DelayedDelete> delayedDelete;
703
704 int ConfiguredPlugin::release()
705 {
706 int x = --refCounter;
707
708#ifdef DEBUG_PLUGINS
709 fprintf(stderr, "ConfiguredPlugin::release %s %d\n", plugName.c_str(), x);
710#endif
711
712 if (x == 0)
713 {
714 { // plugins->mutex scope
715 MutexLockGuard g(plugins->mutex, FB_FUNCTION);
716 if (refCounter != 0)
717 return 1;
718
719 if (Why::timerThreadStopped() && !processingDelayedDelete && delayedDelete)
720 {
721 // delay delete
722 addRef();
723 delayedDelete->push(this);
724
725 return 1;
726 }
727
728 destroy();
729 }
730
731 // Must run out of mutex scope to avoid deadlock with PluginManager::threadDetach()
732 // called when module is unloaded by dtor
733 delete this;
734 return 0;
735 }
736
737 return 1;
738 }
739
740 void ConfiguredPlugin::processDelayedDelete()
741 {

Callers 15

handlerFunction · 0.45
~CtrlCHandlerMethod · 0.45
eventCallbackFunctionMethod · 0.45
destroyMethod · 0.45
executeMethod · 0.45
enterDtcMethod · 0.45

Calls 4

timerThreadStoppedFunction · 0.85
destroyFunction · 0.50
c_strMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected