Commit 91ac79ec authored by Mike Gabriel's avatar Mike Gabriel

Merge pull request #25 from nitomartinez/nxtranscleanup_for_reconnect

This patch allows to cleanup the nxcomp resources to allow for a seco…
parents ab96962b 4fefe352
......@@ -1311,6 +1311,11 @@ void NXTransCleanup()
HandleCleanup();
}
void NXTransCleanupForReconnect()
{
HandleCleanupForReconnect();
}
//
// Check the parameters for subsequent
// initialization of the NX transport.
......@@ -4873,6 +4878,28 @@ int StartKeeper()
return 1;
}
void HandleCleanupForReconnect()
{
#ifdef TEST
*logofs << "Loop: Going to clean up system resources for Reconnect "
<< "in process '" << getpid() << "'.\n"
<< logofs_flush;
#endif
handleTerminatedInLoop();
DisableSignals();
if (control)
CleanupChildren();
CleanupListeners();
CleanupSockets();
CleanupKeeper();
CleanupStreams();
CleanupLocal();
CleanupGlobal();
RestoreSignals();
ServerCache::lastInitReply.set(0,NULL);
ServerCache::lastKeymap.set(0,NULL);
ServerCache::getKeyboardMappingLastMap.set(0,NULL);
}
void HandleCleanup(int code)
{
#ifdef TEST
......
......@@ -140,6 +140,7 @@ void HandleShutdown() __attribute__((noreturn));
extern "C"
{
void HandleCleanup(int code = 0) __attribute__((noreturn));
void HandleCleanupForReconnect();
}
//
......
......@@ -442,6 +442,14 @@ extern int NXTransParseEnvironment(const char *env, int force);
extern void NXTransCleanup(void) __attribute__((noreturn));
/*
* Cleans up the global and local state
* (the same way as NXTransCleanup does)
* but does not exit the process
* Needed for IOS platform
*/
extern void NXTransCleanupForReconnect(void);
extern const char* NXVersion();
extern int NXMajorVersion();
extern int NXMinorVersion();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment