[Pcsclite-cvs-commit] r2077 - trunk/PCSC/src

Ludovic Rousseau rousseau at costa.debian.org
Wed Jun 7 12:59:08 UTC 2006


Author: rousseau
Date: 2006-06-07 12:59:07 +0000 (Wed, 07 Jun 2006)
New Revision: 2077

Modified:
   trunk/PCSC/src/winscard_clnt.c
Log:
SCardUnload(): use SYS_PublicMemoryUnmap() to free the memory mapped
segment.

Thanks to Stefan Schuermans for the bug report and patch


Modified: trunk/PCSC/src/winscard_clnt.c
===================================================================
--- trunk/PCSC/src/winscard_clnt.c	2006-06-07 12:58:14 UTC (rev 2076)
+++ trunk/PCSC/src/winscard_clnt.c	2006-06-07 12:59:07 UTC (rev 2077)
@@ -3247,9 +3247,21 @@
 
 void DESTRUCTOR SCardUnload(void)
 {
+	int i;
+
 	if (!isExecuted)
 		return;
 
+	// unmap public shared file from memory
+	for (i = 0; i < PCSCLITE_MAX_APPLICATION_CONTEXT_CHANNELS; i++)
+	{
+		if (readerStates[i] != NULL)
+		{
+			SYS_PublicMemoryUnmap(readerStates[i], sizeof(READER_STATE));
+			readerStates[i] = NULL;
+		}
+	}
+
 	SYS_CloseFile(mapAddr);
 	isExecuted = 0;
 }




More information about the Pcsclite-cvs-commit mailing list