Browse Source

Destroy the main UI and connection objects before popping up the fatal error

message. This avoids a lot of problems with recursion and trying to send
events over a dead socket.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4582 3789f03b-4d11-0410-bbf8-ca57d06f2519
tags/v1.1.90
Pierre Ossman 13 years ago
parent
commit
e2ef5c1994
3 changed files with 15 additions and 5 deletions
  1. 1
    2
      vncviewer/CConn.cxx
  2. 13
    2
      vncviewer/vncviewer.cxx
  3. 1
    1
      vncviewer/vncviewer.h

+ 1
- 2
vncviewer/CConn.cxx View File

exit_vncviewer(); exit_vncviewer();
} catch (rdr::Exception& e) { } catch (rdr::Exception& e) {
vlog.error(e.str()); vlog.error(e.str());
fl_alert(e.str());
exit_vncviewer();
exit_vncviewer(e.str());
} }


recursing = false; recursing = false;

+ 13
- 2
vncviewer/vncviewer.cxx View File

static char aboutText[1024]; static char aboutText[1024];


static bool exitMainloop = false; static bool exitMainloop = false;
static const char *exitError = NULL;


void exit_vncviewer()
void exit_vncviewer(const char *error)
{ {
// Prioritise the first error we get as that is probably the most
// relevant one.
if ((error != NULL) && (exitError == NULL))
exitError = strdup(error);

exitMainloop = true; exitMainloop = true;
} }


return 1; return 1;
} }


CConn cc(vncServerName);
CConn *cc = new CConn(vncServerName);


while (!exitMainloop) { while (!exitMainloop) {
int next_timer; int next_timer;
} }
} }


delete cc;

if (exitError != NULL)
fl_alert(exitError);

return 0; return 0;
} }

+ 1
- 1
vncviewer/vncviewer.h View File

#ifndef __VNCVIEWER_H__ #ifndef __VNCVIEWER_H__
#define __VNCVIEWER_H__ #define __VNCVIEWER_H__


void exit_vncviewer();
void exit_vncviewer(const char *error = NULL);
void about_vncviewer(); void about_vncviewer();


#endif #endif

Loading…
Cancel
Save