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

Function allClean

src/common/classes/init.cpp:82–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80#endif
81
82 void allClean()
83 {
84 if (initDone != 1)
85 {
86 return;
87 }
88 initDone = 2;
89
90#ifdef WIN_NT
91 if (Firebird::bDllProcessExiting)
92 dontCleanup = true;
93#endif
94 if (dontCleanup)
95 return;
96
97#ifdef DEBUG_GDS_ALLOC
98 Firebird::AutoPtr<FILE> file;
99
100 { // scope
101 char name[PATH_MAX];
102
103 if (os_utils::getCurrentModulePath(name, sizeof(name)))
104 strncat(name, ".memdebug.log", sizeof(name) - 1);
105 else
106 strcpy(name, "memdebug.log");
107
108 file = os_utils::fopen(name, "w+t");
109 }
110#endif // DEBUG_GDS_ALLOC
111
112 Firebird::InstanceControl::destructors();
113
114 if (dontCleanup)
115 return;
116
117 try
118 {
119 Firebird::StaticMutex::release();
120 }
121 catch (...)
122 {
123 cleanError(NULL);
124 }
125
126 try
127 {
128#ifdef DEBUG_GDS_ALLOC
129 // In Debug mode - this will report all memory leaks
130 if (file)
131 {
132 getDefaultMemoryPool()->print_contents(file,
133 Firebird::MemoryPool::PRINT_USED_ONLY | Firebird::MemoryPool::PRINT_RECURSIVE);
134 file = NULL;
135 }
136#endif
137 Firebird::MemoryPool::cleanupDefaultPool();
138 }
139 catch (...)

Callers

nothing calls this directly

Calls 6

cleanErrorFunction · 0.85
getDefaultMemoryPoolFunction · 0.85
releaseFunction · 0.70
getCurrentModulePathFunction · 0.50
fopenFunction · 0.50
print_contentsMethod · 0.45

Tested by

no test coverage detected