From ecc89d859687126ec11aa209b8a7b07b7b691f14 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Tue, 1 May 2012 17:58:42 +0000 Subject: [PATCH] added: two plugin's messages // a session is going to be removed // it is called from session manager's thread (with lock/unlock) #define WINIX_PREPARE_SESSION_TO_REMOVE 30027 // a session has been removed // it is called from session manager's thread (with lock/unlock) // in l1 you have the old session id #define WINIX_SESSION_REMOVED 30029 git-svn-id: svn://ttmath.org/publicrep/winix/trunk@832 e52654a7-88a9-db11-a3e9-0013d4bc506e --- core/pluginmsg.h | 9 +++++++++ core/sessionmanager.cpp | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/core/pluginmsg.h b/core/pluginmsg.h index 7a43ee2..ec4e9cb 100755 --- a/core/pluginmsg.h +++ b/core/pluginmsg.h @@ -64,6 +64,15 @@ // in l1 you have the old id, in l2 you have the new id #define WINIX_SESSION_CHANGED_ID 30025 +// a session is going to be removed +// it is called from session manager's thread (with lock/unlock) +#define WINIX_PREPARE_SESSION_TO_REMOVE 30027 + +// a session has been removed +// it is called from session manager's thread (with lock/unlock) +// in l1 you have the old session id +#define WINIX_SESSION_REMOVED 30029 + // the winix is closing // there is not any sessions available (cur->session is null) // session pointer is null diff --git a/core/sessionmanager.cpp b/core/sessionmanager.cpp index 4a4345c..2eaae89 100755 --- a/core/sessionmanager.cpp +++ b/core/sessionmanager.cpp @@ -514,7 +514,11 @@ void SessionManager::DeleteSession(Session * del_session) del_session->puser = 0; } + long id = del_session->id; + + plugin.Call(del_session, WINIX_PREPARE_SESSION_TO_REMOVE); session_tab.EraseById(del_session->id); + plugin.Call((Session*)0, WINIX_SESSION_REMOVED, id); }