diff --git a/interface/src/AudioData.cpp b/interface/src/AudioData.cpp index 863142faf4..0745a045b5 100644 --- a/interface/src/AudioData.cpp +++ b/interface/src/AudioData.cpp @@ -39,6 +39,7 @@ AudioData::~AudioData() { } } - delete[] samplesToQueue; + + delete audioSocket; } \ No newline at end of file diff --git a/interface/src/UDPSocket.cpp b/interface/src/UDPSocket.cpp index 87e7a6e9e8..a225bb5d34 100644 --- a/interface/src/UDPSocket.cpp +++ b/interface/src/UDPSocket.cpp @@ -51,6 +51,10 @@ UDPSocket::UDPSocket(int listeningPort) { printf("Created UDP socket listening on port %d.\n", listeningPort); } +UDPSocket::~UDPSocket() { + close(handle); +} + bool UDPSocket::receive(void *receivedData, int *receivedBytes) { *receivedBytes = recvfrom(handle, receivedData, MAX_BUFFER_LENGTH_BYTES, diff --git a/interface/src/UDPSocket.h b/interface/src/UDPSocket.h index a360c55287..e2a27e39a8 100644 --- a/interface/src/UDPSocket.h +++ b/interface/src/UDPSocket.h @@ -17,6 +17,7 @@ class UDPSocket { public: UDPSocket(int listening_port); + ~UDPSocket(); int send(char *destAddress, int destPort, const void *data, int byteLength); bool receive(void *receivedData, int *receivedBytes); private: