[Pcsclite-cvs-commit] CVS libmusclecard/src

CVS User rousseau ludovic.rousseau@free.fr
Wed, 06 Apr 2005 14:16:44 +0000


Update of /cvsroot/pcsclite/libmusclecard/src
In directory haydn:/tmp/cvs-serv25090

Modified Files:
	musclecard.c 
Log Message:
MSCReleaseConnection(): call SCardReleaseContext()

Thanks to Karsten Ohme for the patch


--- /cvsroot/pcsclite/libmusclecard/src/musclecard.c	2005/02/22 15:38:54	1.46
+++ /cvsroot/pcsclite/libmusclecard/src/musclecard.c	2005/04/06 14:16:44	1.47
@@ -10,7 +10,7 @@
  * You may not remove this header from this file without 
  * prior permission from the author.
  *
- * $Id: musclecard.c,v 1.46 2005/02/22 15:38:54 rousseau Exp $
+ * $Id: musclecard.c,v 1.47 2005/04/06 14:16:44 rousseau Exp $
  */
 
 #include "config.h"
@@ -25,6 +25,8 @@
 #include "tokenfactory.h"
 #include "strlcpycat.h"
 
+#define USE_THREAD_SAFETY
+
 #ifdef USE_THREAD_SAFETY
 #include <wintypes.h>
 #include <thread_generic.h>
@@ -581,6 +583,16 @@
 		pConnection->tokenLibHandle = 0;
 	}
 
+	/*
+	 * Release Context
+	 */
+	if (pConnection->hContext != 0)
+	{
+		rv = SCardReleaseContext(pConnection->hContext);
+		if (pcscToMSC(rv) != MSC_SUCCESS)
+			return pcscToMSC(rv);
+	}
+
 	pConnection->tokenLibHandle = 0;
 	pConnection->hCard = 0;
 	pConnection->hContext = 0;