- coverity based bug fixes - round #1

This commit is contained in:
SoftCoder
2013-12-13 23:04:12 -08:00
parent c887b0c357
commit b9d6b38e8f
53 changed files with 651 additions and 416 deletions

View File

@@ -68,32 +68,33 @@ const char * getDialogCommand() {
}
bool showMessage(std::string warning,string writepath) {
bool guiMessage = false;
const char * dialogCommand = getDialogCommand();
if (dialogCommand) {
std::string command = dialogCommand;
bool guiMessage = false;
const char * dialogCommand = getDialogCommand();
if (dialogCommand) {
std::string command = dialogCommand;
string text_file = writepath + "/mg_dialog_text.txt";
{
FILE *fp = fopen(text_file.c_str(),"wt");
if (fp != NULL) {
fputs(warning.c_str(),fp);
fclose(fp);
string text_file = writepath + "/mg_dialog_text.txt";
{
FILE *fp = fopen(text_file.c_str(),"wt");
if (fp != NULL) {
fputs(warning.c_str(),fp);
fclose(fp);
}
}
}
//command += " --title \"Error\" --msgbox \"`printf \"" + warning + "\"`\"";
command += " --title \"Error\" --text-info --filename=" + text_file;
//command += " --title \"Error\" --msgbox \"`printf \"" + warning + "\"`\"";
command += " --title \"Error\" --text-info --filename=" + text_file;
//printf("\n\n\nzenity command [%s]\n\n\n",command.c_str());
//printf("\n\n\nzenity command [%s]\n\n\n",command.c_str());
FILE *fp = popen(command.c_str(),"r");
if (fp != 0)
guiMessage = true;
pclose(fp);
}
FILE *fp = popen(command.c_str(),"r");
if (fp != 0) {
guiMessage = true;
pclose(fp);
}
}
return guiMessage;
return guiMessage;
}
void message(string message, bool isNonGraphicalModeEnabled,string writepath) {

View File

@@ -107,7 +107,7 @@ public:
sleep(10);
if(base_thread->getRunningStatus() == true || base_thread->getExecutingTask() == true) {
if(Thread::getEnableVerboseMode()) printf("\n\n\n$$$$$$$$$$$$$$$$$$$$$$$$$$$ cleanupPendingThread Line: %d thread = %p [%s]\n",__LINE__,thread,(base_thread != NULL ? base_thread->getUniqueID().c_str() : "n/a"));
if(Thread::getEnableVerboseMode()) printf("\n\n\n$$$$$$$$$$$$$$$$$$$$$$$$$$$ cleanupPendingThread Line: %d thread = %p [%s]\n",__LINE__,thread,base_thread->getUniqueID().c_str());
char szBuf[8096]="";
snprintf(szBuf,8095,"In [%s::%s Line: %d] cannot delete active thread: getRunningStatus(): %d getExecutingTask: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,base_thread->getRunningStatus(),base_thread->getExecutingTask());
@@ -118,8 +118,9 @@ public:
if(Thread::getEnableVerboseMode()) printf("!!!! cleanupPendingThread Line: %d thread = %p [%s]\n",__LINE__,thread,(base_thread != NULL ? base_thread->getUniqueID().c_str() : "n/a"));
delete thread;
thread = NULL;
if(Thread::getEnableVerboseMode()) printf("!!!! cleanupPendingThread Line: %d thread = %p [%s]\n",__LINE__,thread,(base_thread != NULL ? base_thread->getUniqueID().c_str() : "n/a"));
if(Thread::getEnableVerboseMode()) printf("!!!! cleanupPendingThread Line: %d thread = NULL [%s]\n",__LINE__,(base_thread != NULL ? base_thread->getUniqueID().c_str() : "n/a"));
}
}