From 00faeaa3bd6c40ca01b750aa97e35e918ce9058d Mon Sep 17 00:00:00 2001 From: Dmitry Fleytman Date: Tue, 16 Sep 2014 09:03:36 +0300 Subject: [PATCH] UsbDk: Always delete old pipes information on reconfiguration Signed-off-by: Dmitry Fleytman --- UsbDk/UsbTarget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UsbDk/UsbTarget.cpp b/UsbDk/UsbTarget.cpp index a15330f..29bcbb2 100644 --- a/UsbDk/UsbTarget.cpp +++ b/UsbDk/UsbTarget.cpp @@ -40,13 +40,14 @@ NTSTATUS CWdfUsbInterface::SetAltSetting(ULONG64 AltSettingIdx) return status; } + m_Pipes.reset(); + m_NumPipes = WdfUsbInterfaceGetNumConfiguredPipes(m_Interface); if (m_NumPipes == 0) { return STATUS_SUCCESS; } - m_Pipes.destroy(); m_Pipes = new CWdfUsbPipe[m_NumPipes]; if (!m_Pipes) {