length = wave->length > audioBuffer->mAudioDataBytesCapacity ? audioBuffer->mAudioDataBytesCapacity : wave->length;
CopyMemory(audioBuffer->mAudioData, wave->data, length);
+ free(wave->data);
+ wave->data = NULL;
audioBuffer->mAudioDataByteSize = length;
audioBuffer->mUserData = wave;
* Copyright 2012-2013 Marc-Andre Moreau <marcandre.moreau@gmail.com>
* Copyright 2015 Thincast Technologies GmbH
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
+ * Copyright 2016 David PHAM-VAN <d.phamvan@inuvika.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
break;
case CHANNEL_EVENT_TERMINATED:
+ if (plugin->thread != NULL)
+ if ((error = rdpsnd_virtual_channel_event_disconnected(plugin)))
+ WLog_ERR(TAG, "rdpsnd_virtual_channel_event_disconnected failed with error %lu!", error);
rdpsnd_virtual_channel_event_terminated(plugin);
break;
}
* Copyright 2010-2012 Vic Lee
* Copyright 2015 Thincast Technologies GmbH
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
+ * Copyright 2016 David PHAM-VAN <d.phamvan@inuvika.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
winmm->device.WaveConfirm(&(winmm->device), wave);
free(lpWaveHdr->lpData);
+ free(lpWaveHdr);
free(wave);
}
{
WLog_ERR(TAG, "waveOutWrite failure: %d", mmResult);
waveOutUnprepareHeader(winmm->hWaveOut, lpWaveHdr, sizeof(WAVEHDR));
+ free(lpWaveHdr);
return;
}
}