summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcacard/vcard.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libcacard/vcard.c b/libcacard/vcard.c
index 87ad5166a8..d140a8ed1a 100644
--- a/libcacard/vcard.c
+++ b/libcacard/vcard.c
@@ -250,6 +250,11 @@ void
vcard_select_applet(VCard *card, int channel, VCardApplet *applet)
{
assert(channel < MAX_CHANNEL);
+
+ /* If using an emulated card, make sure to log out of any already logged in
+ * session. */
+ vcard_emul_logout(card);
+
card->current_applet[channel] = applet;
/* reset the applet */
if (applet && applet->reset_applet) {