Browse Source

Fix desallocation of remaining clients when server quits.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2756 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.90
sletz 17 years ago
parent
commit
774f25f574
4 changed files with 14 additions and 12 deletions
  1. +4
    -0
      ChangeLog
  2. +5
    -7
      common/JackEngine.cpp
  3. +1
    -1
      common/JackRequest.h
  4. +4
    -4
      common/JackSocket.cpp

+ 4
- 0
ChangeLog View File

@@ -22,6 +22,10 @@ Florian Faber
Jackdmp changes log
---------------------------

2008-08-01 Stephane Letz <letz@grame.fr>

* Fix desallocation of remaining clients when server quits.

2008-07-25 Stephane Letz <letz@grame.fr>

* Florian Faber patch for 32 bit float (LE only) support to jack's alsa driver.


+ 5
- 7
common/JackEngine.cpp View File

@@ -78,13 +78,11 @@ int JackEngine::Close()
// Close (possibly) remaining clients (RT is stopped)
for (int i = 0; i < CLIENT_NUM; i++) {
/*
Can only delete clients that where loaded using "jack_internal_client_load" (and not properly unloaded using "jack_internal_client_unload"...)
*/
JackLoadableInternalClient* loadable_client = dynamic_cast<JackLoadableInternalClient*>(fClientTable[i]);
if (loadable_client) {
jack_log("JackEngine::Close delete loadable client %ld", i);
delete loadable_client;
JackClientInterface* client = fClientTable[i];
if (client) {
jack_log("JackEngine::Close client = %s", client->GetClientControl()->fName);
client->Close();
delete client;
fClientTable[i] = NULL;
}
}


+ 1
- 1
common/JackRequest.h View File

@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Jack
{

#define CheckRes(res) {if (res < 0) return res;}
#define CheckRes(exp) { if ((exp) < 0) return -1;}

/*!
\brief Request from client to server.


+ 4
- 4
common/JackSocket.cpp View File

@@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "JackError.h"
#include <string.h>
#include <stdio.h>
#include <pthread.h>

namespace Jack
{
@@ -120,9 +121,9 @@ int JackClientSocket::Connect(const char* dir, int which)

int JackClientSocket::Close()
{
jack_log("JackClientSocket::Close");
//shutdown(fSocket, SHUT_RDWR);
jack_log("JackClientSocket::Close");
if (fSocket > 0) {
shutdown(fSocket, SHUT_RDWR);
close(fSocket);
fSocket = -1;
return 0;
@@ -272,10 +273,9 @@ JackClientSocket* JackServerSocket::Accept()

int JackServerSocket::Close()
{
//shutdown(fSocket, SHUT_RDWR);
if (fSocket > 0) {
jack_log("JackServerSocket::Close %s", fName);
//shutdown(fSocket, SHUT_RDWR);
shutdown(fSocket, SHUT_RDWR);
close(fSocket);
unlink(fName);
fSocket = -1;


Loading…
Cancel
Save