Skip to content

Commit

Permalink
- Fixed: codelite hangs under Mac in some cases where it fails to lau…
Browse files Browse the repository at this point in the history
…nch the debugger

git-svn-id: https://codelite.svn.sourceforge.net/svnroot/codelite/trunk@4581 9da81c78-c036-0410-9e1f-a2b0375e4b5a
  • Loading branch information
eranif committed Nov 10, 2010
1 parent 58a18f8 commit e3aa06d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
20 changes: 6 additions & 14 deletions CodeLite/asyncprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ class IProcess;
# include "unixprocess_impl.h"
#endif

// statics
wxCriticalSection IProcess::m_cs;
std::map<int, int> IProcess::m_exitCodeMap;

IProcess* CreateAsyncProcess(wxEvtHandler *parent, const wxString& cmd, IProcessCreateFlags flags, const wxString &workingDir)
{
#ifdef __WXMSW__
Expand All @@ -26,19 +22,15 @@ IProcess* CreateAsyncProcess(wxEvtHandler *parent, const wxString& cmd, IProcess
// Static methods:
bool IProcess::GetProcessExitCode(int pid, int &exitCode)
{
wxCriticalSectionLocker locker(m_cs);

std::map<int, int>::iterator iter = m_exitCodeMap.find(pid);
if(iter == m_exitCodeMap.end()) {
return false;
}
exitCode = iter->second;
wxUnusedVar(pid);
wxUnusedVar(exitCode);

exitCode = 0;
return true;
}

void IProcess::SetProcessExitCode(int pid, int exitCode)
{
wxCriticalSectionLocker locker(m_cs);
m_exitCodeMap[pid] = exitCode;
wxUnusedVar(pid);
wxUnusedVar(exitCode);
}

2 changes: 0 additions & 2 deletions CodeLite/asyncprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ class WXDLLIMPEXP_CL IProcess
wxEvtHandler * m_parent;
int m_pid;
bool m_hardKill;
static std::map<int, int> m_exitCodeMap;
static wxCriticalSection m_cs;

public:
IProcess(wxEvtHandler *parent) : m_parent(parent), m_pid(-1), m_hardKill(false) {}
Expand Down
8 changes: 6 additions & 2 deletions LiteEditor/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static void ChildTerminatedSingalHandler(int signo)
if(pid > 0) {
// waitpid succeeded
IProcess::SetProcessExitCode(pid, WEXITSTATUS(status));

} else {
break;

Expand Down Expand Up @@ -423,10 +423,14 @@ bool CodeLiteApp::OnInit()
// set the CTAGS_REPLACEMENT environment variable
wxSetEnv(wxT("CTAGS_REPLACEMENTS"), ManagerST::Get()->GetStarupDirectory() + wxT("/ctags.replacements"));

//show splashscreen here
// show splashscreen here
long style = wxSIMPLE_BORDER;
#if defined (__WXMSW__) || defined (__WXGTK__)
style |= wxFRAME_NO_TASKBAR;

#else // Mac
wxUnusedVar(style);

#endif

//read the last frame size from the configuration file
Expand Down

0 comments on commit e3aa06d

Please sign in to comment.