Moved implentation of constructor/destructor inside the class to make it link (by...
[moonshot-firefox.git] / nsMoonshotSessionState.h
index 7e623d8..42caaaf 100644 (file)
@@ -10,13 +10,30 @@ typedef enum {
     GSS_CTX_ESTABLISHED
 } gss_state_t;
 
-class nsMoonshotSessionState : public nsISupports
+class NS_EXPORT
+nsMoonshotSessionState : public nsISupports
 {
     public:
        NS_DECL_ISUPPORTS
 
-       nsMoonshotSessionState();
-       virtual ~nsMoonshotSessionState();
+       nsMoonshotSessionState() {
+           gss_ctx = GSS_C_NO_CONTEXT;
+           gss_state = GSS_CTX_EMPTY;
+           gss_cred = GSS_C_NO_CREDENTIAL;
+       }
+
+       virtual ~nsMoonshotSessionState() {
+           OM_uint32 min_stat;
+
+           if (gss_ctx != GSS_C_NO_CONTEXT)
+               gss_delete_sec_context(&min_stat, &gss_ctx, GSS_C_NO_BUFFER);
+           if (gss_cred != GSS_C_NO_CREDENTIAL)
+               gss_release_cred(&min_stat, &gss_cred);
+           gss_ctx = GSS_C_NO_CONTEXT;
+           gss_cred = GSS_C_NO_CREDENTIAL;
+           gss_state = GSS_CTX_EMPTY;
+       }
+
        void Reset();
 
        gss_state_t gss_state;