9 #error *****Isis.h MUST be included before any other files!*****
16 #include <QCoreApplication>
22 #define APPLICATION IsisMain
72 std::map<QString, void *> empty;
93 int main(
int argc,
char *argv[]) {
97 if (getenv(
"ISISROOT") == NULL || QString(getenv(
"ISISROOT")) ==
"") {
98 std::cerr <<
"Please set ISISROOT before running any Isis applications" << std::endl;
105 signal(SIGABRT,
Abort);
119 delete QCoreApplication::instance();
126 MyMutex *mutex =
new MyMutex();
127 std::fstream *alloc_output =
new std::fstream(
"/dev/null");
128 Debug(make_all_allocations_invisible_except(NULL));
129 ForAllDebugChannels(
if(debugChannel.is_on()) debugChannel.off());
130 Debug(dc::malloc.on());
131 Debug(libcw_do.on());
132 Debug(libcw_do.set_ostream(alloc_output));
133 Debug(libcw_do.set_ostream(alloc_output, mutex));
142 alloc_filter_ct alloc_filter;
143 std::vector<std::string> objmasks;
144 objmasks.push_back(
"libc.so*");
145 objmasks.push_back(
"libstdc++*");
146 std::vector<std::string> srcmasks;
147 srcmasks.push_back(
"*new_allocator.h*");
148 srcmasks.push_back(
"*set_ostream.inl*");
149 alloc_filter.hide_objectfiles_matching(objmasks);
150 alloc_filter.hide_sourcefiles_matching(srcmasks);
151 alloc_filter.hide_unknown_locations();
152 delete libcw_do.get_ostream();
153 libcw_do.set_ostream(&std::cout);
154 list_allocations_on(libcw_do, alloc_filter);
163 std::vector<std::string> currentStack;
166 std::cerr <<
"Segmentation Fault" << std::endl;
167 for(
unsigned int i = 1; i < currentStack.size(); i++) {
168 std::cerr << currentStack[i] << std::endl;
175 std::vector<std::string> currentStack;
178 std::cerr <<
"Abort" << std::endl;
179 for(
unsigned int i = 1; i < currentStack.size(); i++) {
180 std::cerr << currentStack[i] << std::endl;